Added support for allowing password to updated from the PUT request to the user rest endpoint.

This commit is contained in:
Nicholas Staples
2016-01-28 11:41:21 +00:00
parent 8657c0ea40
commit 66c1d858ac
4 changed files with 87 additions and 15 deletions

View File

@@ -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']