fix incorrect usage of add_field_errors in schema.py

This commit is contained in:
ahmadbilalkhalid 2019-11-21 16:46:59 +05:00
parent c8b67c5c50
commit 44fc8d4615

View file

@ -199,7 +199,7 @@ class DeleteOTPSchema(DataRequiredSchema):
def admin_realm_validation(self): def admin_realm_validation(self):
if self.admin_realm.value != decouple.config("ADMIN_REALM"): if self.admin_realm.value != decouple.config("ADMIN_REALM"):
self.add_field_errors( self.add_error(
"Admin must be from {} realm".format(decouple.config("ADMIN_REALM")) "Admin must be from {} realm".format(decouple.config("ADMIN_REALM"))
) )
@ -233,7 +233,7 @@ class ListAccountSchema(DataRequiredSchema):
def admin_realm_validation(self): def admin_realm_validation(self):
if self.admin_realm.value != decouple.config("ADMIN_REALM"): if self.admin_realm.value != decouple.config("ADMIN_REALM"):
self.add_field_errors( self.add_error(
"Admin must be from {} realm".format(decouple.config("ADMIN_REALM")) "Admin must be from {} realm".format(decouple.config("ADMIN_REALM"))
) )