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:
Leo Hemsted
2017-01-09 16:37:58 +00:00
parent 098567c151
commit 501187a9f4
8 changed files with 31 additions and 32 deletions
+4 -4
View File
@@ -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):