mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Allow test key to send irrespective of daily limit
When you use a simulate API key it should behave like a live service, except for actually sending the messages. There should be no limits even if the service is in trial mode. This commit removes the restriction on sending messages when you’ve sent up to your daily limit.
This commit is contained in:
@@ -215,7 +215,10 @@ def send_notification(notification_type):
|
||||
|
||||
service_stats = sum(row.count for row in dao_fetch_todays_stats_for_service(service.id))
|
||||
|
||||
if service_stats >= service.message_limit:
|
||||
if all((
|
||||
api_user.key_type != KEY_TYPE_TEST,
|
||||
service_stats >= service.message_limit
|
||||
)):
|
||||
error = 'Exceeded send limits ({}) for today'.format(service.message_limit)
|
||||
raise InvalidRequest(error, status_code=429)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user