mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Merge pull request #3939 from alphagov/check-daily-limit-for-csv-uploads
Check the daily limit get the daily notification_count from redis.
This commit is contained in:
@@ -272,7 +272,6 @@ def get_notifications(service_id, message_type, status_override=None):
|
||||
message_type,
|
||||
service_api_client.get_service_statistics(
|
||||
service_id,
|
||||
today_only=False,
|
||||
limit_days=service_data_retention_days
|
||||
)
|
||||
)
|
||||
|
||||
@@ -612,8 +612,8 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
|
||||
if e.status_code != 404:
|
||||
raise
|
||||
|
||||
statistics = service_api_client.get_service_statistics(service_id, today_only=True)
|
||||
remaining_messages = (current_service.message_limit - sum(stat['requested'] for stat in statistics.values()))
|
||||
notification_count = service_api_client.get_notification_count(service_id)
|
||||
remaining_messages = (current_service.message_limit - notification_count)
|
||||
|
||||
contents = s3download(service_id, upload_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user