mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-06 05:08:25 -04:00
Move VERIFY_CODE_TYPES outside the class and use it in the schema
This commit is contained in:
@@ -60,7 +60,7 @@ class JobSchema(BaseSchema):
|
||||
|
||||
class RequestVerifyCodeSchema(ma.Schema):
|
||||
def verify_code_type(self):
|
||||
if self not in ['sms', 'email']:
|
||||
if self not in models.VERIFY_CODE_TYPES:
|
||||
raise ValidationError('Invalid code type')
|
||||
|
||||
code_type = fields.Str(required=True, validate=verify_code_type)
|
||||
|
||||
Reference in New Issue
Block a user