Update limit to message_limit.

Further db changes and updates.

Remove traceback print out.

Fix bug in passing template id to a task.
This commit is contained in:
Nicholas Staples
2016-04-08 16:13:10 +01:00
parent c4b316bde6
commit 90f0505a3d
19 changed files with 116 additions and 116 deletions

View File

@@ -287,8 +287,9 @@ def send_notification(notification_type):
total_sms_count = service_stats.sms_requested
total_email_count = service_stats.emails_requested
if (total_email_count + total_sms_count >= service.limit) and service.restricted:
return jsonify(result="error", message='Exceeded send limits ({}) for today'.format(service.limit)), 429
if (total_email_count + total_sms_count >= service.message_limit) and service.restricted:
return jsonify(result="error", message='Exceeded send limits ({}) for today'.format(
service.message_limit)), 429
notification, errors = (
sms_template_notification_schema if notification_type == 'sms' else email_notification_schema