mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Added support for allowing password to updated from the PUT request to the user rest endpoint.
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