Daily message limit imposed for service api calls.

This commit is contained in:
Adam Shimali
2016-07-14 11:25:45 +01:00
parent 496bc05eea
commit 9f9040869d
2 changed files with 9 additions and 30 deletions

View File

@@ -221,7 +221,7 @@ 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.message_limit) and service.restricted:
if (total_email_count + total_sms_count >= service.message_limit):
error = 'Exceeded send limits ({}) for today'.format(service.message_limit)
raise InvalidRequest(error, status_code=429)