mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 15:28:50 -04:00
Only actually call api to verify code if both are present in form.
This commit is contained in:
@@ -168,10 +168,12 @@ class VerifyForm(Form):
|
||||
raise ValidationError(reason)
|
||||
|
||||
def validate_email_code(self, field):
|
||||
self._validate_code(field.data, 'email')
|
||||
if self.sms_code.data:
|
||||
self._validate_code(field.data, 'email')
|
||||
|
||||
def validate_sms_code(self, field):
|
||||
self._validate_code(field.data, 'sms')
|
||||
if self.email_code.data:
|
||||
self._validate_code(field.data, 'sms')
|
||||
|
||||
|
||||
class EmailNotReceivedForm(Form):
|
||||
|
||||
Reference in New Issue
Block a user