mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 18:38:14 -04:00
bump utils to 13.0.1
brings in a fix to InvalidEmail/Phone/AddressExceptions not being instantiated correctly. `exception.message` is not a python standard, so we shouldn't be relying on it to transmit exception reasons - rather we should be using `str(exception)` instead. This involved a handful of small changes to the schema validation
This commit is contained in:
+4
-4
@@ -124,7 +124,7 @@ class UserUpdateAttributeSchema(BaseSchema):
|
||||
try:
|
||||
validate_email_address(value)
|
||||
except InvalidEmailError as e:
|
||||
raise ValidationError(e.message)
|
||||
raise ValidationError(str(e))
|
||||
|
||||
@validates('mobile_number')
|
||||
def validate_mobile_number(self, value):
|
||||
@@ -314,7 +314,7 @@ class EmailNotificationSchema(NotificationSchema):
|
||||
try:
|
||||
validate_email_address(value)
|
||||
except InvalidEmailError as e:
|
||||
raise ValidationError(e.message)
|
||||
raise ValidationError(str(e))
|
||||
|
||||
|
||||
class SmsTemplateNotificationSchema(SmsNotificationSchema):
|
||||
@@ -413,7 +413,7 @@ class InvitedUserSchema(BaseSchema):
|
||||
try:
|
||||
validate_email_address(value)
|
||||
except InvalidEmailError as e:
|
||||
raise ValidationError(e.message)
|
||||
raise ValidationError(str(e))
|
||||
|
||||
|
||||
class PermissionSchema(BaseSchema):
|
||||
@@ -446,7 +446,7 @@ class EmailDataSchema(ma.Schema):
|
||||
try:
|
||||
validate_email_address(value)
|
||||
except InvalidEmailError as e:
|
||||
raise ValidationError(e.message)
|
||||
raise ValidationError(str(e))
|
||||
|
||||
|
||||
class NotificationsFilterSchema(ma.Schema):
|
||||
|
||||
Reference in New Issue
Block a user