diff --git a/adjutant/api/v1/tests/test_api_taskview.py b/adjutant/api/v1/tests/test_api_taskview.py index 3ecb0e0..f24c1dd 100644 --- a/adjutant/api/v1/tests/test_api_taskview.py +++ b/adjutant/api/v1/tests/test_api_taskview.py @@ -967,7 +967,7 @@ class DelegateAPITests(AdjutantAPITestCase): self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) self.assertEqual(response.json(), {"notes": ["task created"]}) - self.assertEqual(len(mail.outbox), 1) + self.assertEqual(len(mail.outbox), 2) new_token = Token.objects.all()[0] url = "/v1/tokens/" + new_token.token @@ -976,6 +976,7 @@ class DelegateAPITests(AdjutantAPITestCase): response = self.client.post(url, data, format="json") self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(user.email, "new_test@example.com") + self.assertEqual(len(mail.outbox), 3) def test_update_email_task_not_authenticated(self): """ diff --git a/adjutant/tasks/v1/users.py b/adjutant/tasks/v1/users.py index 4067448..ab3eae5 100644 --- a/adjutant/tasks/v1/users.py +++ b/adjutant/tasks/v1/users.py @@ -77,7 +77,7 @@ class UpdateUserEmail(BaseTask): ] action_config = { "SendAdditionalEmailAction": { - "initial": { + "prepare": { "subject": "OpenStack Email Update Requested", "template": "update_user_email_started.txt", "email_current_user": True,