mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Merge pull request #39 from alphagov/add_password_update
Added support for allowing password to updated from the PUT request t…
This commit is contained in:
@@ -9,7 +9,10 @@ def create_secret_code():
|
||||
return ''.join(map(str, random.sample(range(9), 5)))
|
||||
|
||||
|
||||
def save_model_user(usr, update_dict={}):
|
||||
def save_model_user(usr, update_dict={}, pwd=None):
|
||||
if pwd:
|
||||
usr.password = pwd
|
||||
usr.password_changed_at = datetime.now()
|
||||
if update_dict:
|
||||
if update_dict.get('id'):
|
||||
del update_dict['id']
|
||||
|
||||
Reference in New Issue
Block a user