diff --git a/.gitignore b/.gitignore index c297726..f2299e4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ *.sqlite3 *~ *.log -adjutant.egg-info/* +python_adjutant.egg-info/* dist/* .tox/* env/* diff --git a/adjutant/actions/v1/projects.py b/adjutant/actions/v1/projects.py index ef82ad9..1c80b80 100644 --- a/adjutant/actions/v1/projects.py +++ b/adjutant/actions/v1/projects.py @@ -166,6 +166,8 @@ class NewProjectWithUserAction(UserNameAction, ProjectMixin, UserMixin): # add to cache to use in template self.action.task.cache['user_state'] = "disabled" self.action.need_token = True + # as they are disabled we'll reset their password + self.set_token_fields(["password"]) self.add_note( "Existing disabled user '%s' with matching email." % self.email) diff --git a/adjutant/actions/v1/tests/test_project_actions.py b/adjutant/actions/v1/tests/test_project_actions.py index 6553ded..ae68636 100644 --- a/adjutant/actions/v1/tests/test_project_actions.py +++ b/adjutant/actions/v1/tests/test_project_actions.py @@ -300,6 +300,9 @@ class ProjectActionTests(TestCase): {'user_id': 'user_id_1', 'project_id': 'project_id_1', 'user_state': 'disabled'}) + self.assertEquals( + action.action.cache["token_fields"], + ['password']) # submit password reset token_data = {'password': '123456'}