Fix bug with signups and disabled users
* Token field for password was not being set. * Have also added to test to confirm this. Change-Id: I5e9c21ee4675181f21a889bfe7187995db05576a
This commit is contained in:
parent
f1f0a6d87b
commit
ca21dabdf8
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,7 +2,7 @@
|
||||
*.sqlite3
|
||||
*~
|
||||
*.log
|
||||
adjutant.egg-info/*
|
||||
python_adjutant.egg-info/*
|
||||
dist/*
|
||||
.tox/*
|
||||
env/*
|
||||
|
@ -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)
|
||||
|
@ -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'}
|
||||
|
Loading…
Reference in New Issue
Block a user