diff --git a/app/main/forms.py b/app/main/forms.py index 784b8f2e8..05114c362 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -493,19 +493,6 @@ class ChangeMobileNumberForm(StripWhitespaceForm): mobile_number = international_phone_number() -class ConfirmMobileNumberForm(StripWhitespaceForm): - def __init__(self, validate_code_func, *args, **kwargs): - self.validate_code_func = validate_code_func - super(ConfirmMobileNumberForm, self).__init__(*args, **kwargs) - - sms_code = sms_code() - - def validate_sms_code(self, field): - is_valid, msg = self.validate_code_func(field.data) - if not is_valid: - raise ValidationError(msg) - - class ChooseTimeForm(StripWhitespaceForm): def __init__(self, *args, **kwargs): diff --git a/app/main/views/user_profile.py b/app/main/views/user_profile.py index 47abc7e0c..335d7526d 100644 --- a/app/main/views/user_profile.py +++ b/app/main/views/user_profile.py @@ -18,8 +18,8 @@ from app.main.forms import ( ChangeMobileNumberForm, ChangeNameForm, ChangePasswordForm, - ConfirmMobileNumberForm, ConfirmPasswordForm, + TwoFactorForm, ) from app.utils import is_gov_user @@ -169,7 +169,7 @@ def user_profile_mobile_number_confirm(): if NEW_MOBILE_PASSWORD_CONFIRMED not in session: return redirect(url_for('.user_profile_mobile_number')) - form = ConfirmMobileNumberForm(_check_code) + form = TwoFactorForm(_check_code) if form.validate_on_submit(): user = user_api_client.get_user(current_user.id)