mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Fix error messages on one off sending
This was causing a 500 in production.
This commit:
- reverts the code the working state it was before 68a1426e58
- figures out a way to make the tests pass without breaking the actual
app
- confirms that mocking things is hard
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