mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 19:33:12 -04:00
All tests passing and merged with master.
This commit is contained in:
@@ -38,6 +38,7 @@ def update_user(user):
|
||||
def increment_failed_login_count(id):
|
||||
user = get_user_by_id(id)
|
||||
user.failed_login_count += 1
|
||||
return user_api_client.update_user(user)
|
||||
|
||||
|
||||
def activate_user(user):
|
||||
@@ -45,38 +46,19 @@ def activate_user(user):
|
||||
return user_api_client.update_user(user)
|
||||
|
||||
|
||||
def update_email_address(id, email_address):
|
||||
user = get_user_by_id(id)
|
||||
user.email_address = email_address
|
||||
# TODO update user
|
||||
|
||||
|
||||
def is_email_unique(email_address):
|
||||
if user_api_client.get_user_by_email(email_address):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def update_mobile_number(id, mobile_number):
|
||||
user = get_user_by_id(id)
|
||||
user.mobile_number = mobile_number
|
||||
# TODO update user
|
||||
|
||||
|
||||
def update_password(user, password):
|
||||
user.password = hashpw(password)
|
||||
user.password_changed_at = datetime.now()
|
||||
user.state = 'active'
|
||||
# TODO update user
|
||||
|
||||
|
||||
def request_password_reset(email):
|
||||
user = get_user_by_email(email)
|
||||
user.state = 'request_password_reset'
|
||||
# TODO update user
|
||||
|
||||
|
||||
def send_verify_code(user_id, code_type):
|
||||
def send_verify_code(user_id, code_type, to=None):
|
||||
return user_api_client.send_verify_code(user_id, code_type)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user