mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Remove old method of updating email_access_validated_at
Previously we were passing a flag to the API which handled this. Now we are doing it at the time of clicking the link, not at the time of storing the new password. We don’t need to update the timestamp twice, so this commit removes the code which tells the API to do it.
This commit is contained in:
@@ -114,8 +114,8 @@ class User(JSONModel, UserMixin):
|
||||
response = user_api_client.update_user_attribute(self.id, **kwargs)
|
||||
self.__init__(response)
|
||||
|
||||
def update_password(self, password, validated_email_access=False):
|
||||
response = user_api_client.update_password(self.id, password, validated_email_access=validated_email_access)
|
||||
def update_password(self, password):
|
||||
response = user_api_client.update_password(self.id, password)
|
||||
self.__init__(response)
|
||||
|
||||
def update_email_access_validated_at(self):
|
||||
|
||||
@@ -74,10 +74,8 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
return user_data['data']
|
||||
|
||||
@cache.delete('user-{user_id}')
|
||||
def update_password(self, user_id, password, validated_email_access=False):
|
||||
def update_password(self, user_id, password):
|
||||
data = {"_password": password}
|
||||
if validated_email_access:
|
||||
data["validated_email_access"] = validated_email_access
|
||||
url = "/user/{}/update-password".format(user_id)
|
||||
user_data = self.post(url, data=data)
|
||||
return user_data['data']
|
||||
|
||||
@@ -23,7 +23,7 @@ def log_in_user(user_id):
|
||||
session['current_session_id'] = user.current_session_id
|
||||
# Check if coming from new password page
|
||||
if 'password' in session.get('user_details', {}):
|
||||
user.update_password(session['user_details']['password'], validated_email_access=True)
|
||||
user.update_password(session['user_details']['password'])
|
||||
user.activate()
|
||||
user.login()
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user