mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Fix bug on organisation-usage page.
The dict is initialised for all live services, but if the organisation has trial mode services they cause a key error.
This commit is contained in:
@@ -554,7 +554,8 @@ def fetch_letter_costs_for_organisation(organisation_id, start_date, end_date):
|
||||
FactBilling.bst_date >= start_date,
|
||||
FactBilling.bst_date <= end_date,
|
||||
FactBilling.notification_type == LETTER_TYPE,
|
||||
Service.organisation_id == organisation_id
|
||||
Service.organisation_id == organisation_id,
|
||||
Service.restricted.is_(False)
|
||||
).group_by(
|
||||
Service.id,
|
||||
Service.name,
|
||||
@@ -579,7 +580,8 @@ def fetch_email_usage_for_organisation(organisation_id, start_date, end_date):
|
||||
FactBilling.bst_date >= start_date,
|
||||
FactBilling.bst_date <= end_date,
|
||||
FactBilling.notification_type == EMAIL_TYPE,
|
||||
Service.organisation_id == organisation_id
|
||||
Service.organisation_id == organisation_id,
|
||||
Service.restricted.is_(False)
|
||||
).group_by(
|
||||
Service.id,
|
||||
Service.name,
|
||||
@@ -621,7 +623,8 @@ def fetch_sms_billing_for_organisation(organisation_id, start_date, end_date):
|
||||
FactBilling.bst_date >= start_date,
|
||||
FactBilling.bst_date <= end_date,
|
||||
FactBilling.notification_type == SMS_TYPE,
|
||||
Service.organisation_id == organisation_id
|
||||
Service.organisation_id == organisation_id,
|
||||
Service.restricted.is_(False)
|
||||
).group_by(
|
||||
Service.id,
|
||||
Service.name,
|
||||
|
||||
Reference in New Issue
Block a user