Message limit added and all tests passing.

This commit is contained in:
Nicholas Staples
2016-04-29 10:36:59 +01:00
parent 87a02cba14
commit f71dbe9c0f
9 changed files with 135 additions and 36 deletions

View File

@@ -338,6 +338,12 @@ def send_notification(notification_type):
}
), 400
if template_object.replaced_content_count > current_app.config.get('SMS_CHAR_COUNT_LIMIT'):
return jsonify(
result="error",
message={'content': ['Content has a character count greater than the limit of {}'.format(
current_app.config.get('SMS_CHAR_COUNT_LIMIT'))]}), 400
if service.restricted and not allowed_to_send_to(
notification['to'],
itertools.chain.from_iterable(