mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Removed unused form.
And used session.pop to remove NEW_EMAIL from the session. Also removed variable not being used in user_profile.
This commit is contained in:
@@ -22,7 +22,6 @@ from wtforms.fields.html5 import EmailField, TelField
|
|||||||
from wtforms.validators import (DataRequired, Email, Length, Regexp, Optional)
|
from wtforms.validators import (DataRequired, Email, Length, Regexp, Optional)
|
||||||
|
|
||||||
from app.main.validators import (Blacklist, CsvFileValidator, ValidEmailDomainRegex, NoCommasInPlaceHolders)
|
from app.main.validators import (Blacklist, CsvFileValidator, ValidEmailDomainRegex, NoCommasInPlaceHolders)
|
||||||
from app.notify_client.api_key_api_client import KEY_TYPE_NORMAL, KEY_TYPE_TEST, KEY_TYPE_TEAM
|
|
||||||
|
|
||||||
|
|
||||||
def get_time_value_and_label(future_time):
|
def get_time_value_and_label(future_time):
|
||||||
@@ -285,19 +284,6 @@ class ChangeEmailForm(Form):
|
|||||||
raise ValidationError("The email address is already in use")
|
raise ValidationError("The email address is already in use")
|
||||||
|
|
||||||
|
|
||||||
class ConfirmEmailForm(Form):
|
|
||||||
def __init__(self, validate_code_func, *args, **kwargs):
|
|
||||||
self.validate_code_func = validate_code_func
|
|
||||||
super(ConfirmEmailForm, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
email_code = email_code()
|
|
||||||
|
|
||||||
def validate_email_code(self, field):
|
|
||||||
is_valid, msg = self.validate_code_func(field.data)
|
|
||||||
if not is_valid:
|
|
||||||
raise ValidationError(msg)
|
|
||||||
|
|
||||||
|
|
||||||
class ChangeMobileNumberForm(Form):
|
class ChangeMobileNumberForm(Form):
|
||||||
mobile_number = mobile_number()
|
mobile_number = mobile_number()
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ from app import user_api_client
|
|||||||
|
|
||||||
NEW_EMAIL = 'new-email'
|
NEW_EMAIL = 'new-email'
|
||||||
NEW_MOBILE = 'new-mob'
|
NEW_MOBILE = 'new-mob'
|
||||||
NEW_EMAIL_PASSWORD_CONFIRMED = 'new-email-password-confirmed'
|
|
||||||
NEW_MOBILE_PASSWORD_CONFIRMED = 'new-mob-password-confirmed'
|
NEW_MOBILE_PASSWORD_CONFIRMED = 'new-mob-password-confirmed'
|
||||||
|
|
||||||
|
|
||||||
@@ -110,8 +109,7 @@ def user_profile_email_confirm(token):
|
|||||||
user = user_api_client.get_user(user_id)
|
user = user_api_client.get_user(user_id)
|
||||||
user.email_address = new_email
|
user.email_address = new_email
|
||||||
user_api_client.update_user(user)
|
user_api_client.update_user(user)
|
||||||
if session.get(NEW_EMAIL, None):
|
session.pop(NEW_EMAIL, None)
|
||||||
del session[NEW_EMAIL]
|
|
||||||
|
|
||||||
return redirect(url_for('.user_profile'))
|
return redirect(url_for('.user_profile'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user