mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-20 10:24:39 -05:00
More Python client weirdness
There’s some weird interaction between the message attribute of the exception and mocking. Luckily there is an internal attribute – `_message` which doesn’t go through all the magic.
This commit is contained in:
@@ -668,11 +668,11 @@ def _check_notification(service_id, template_id, exception=None):
|
||||
|
||||
def get_template_error_dict(exception):
|
||||
# TODO: Make API return some computer-friendly identifier as well as the end user error messages
|
||||
if 'service is in trial mode' in exception.message:
|
||||
if 'service is in trial mode' in exception._message:
|
||||
error = 'not-allowed-to-send-to'
|
||||
elif 'Exceeded send limits' in exception.message:
|
||||
elif 'Exceeded send limits' in exception._message:
|
||||
error = 'too-many-messages'
|
||||
elif 'Content for template has a character count greater than the limit of' in exception.message:
|
||||
elif 'Content for template has a character count greater than the limit of' in exception._message:
|
||||
error = 'message-too-long'
|
||||
else:
|
||||
raise exception
|
||||
|
||||
Reference in New Issue
Block a user