mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 06:28:25 -04:00
fix test
This commit is contained in:
@@ -1153,9 +1153,19 @@ def get_service_message_ratio():
|
|||||||
messages_sent = dao_get_notification_count_for_service_message_ratio(
|
messages_sent = dao_get_notification_count_for_service_message_ratio(
|
||||||
service_id, current_year
|
service_id, current_year
|
||||||
)
|
)
|
||||||
|
messages_remaining = my_service.total_message_limit - messages_sent
|
||||||
|
|
||||||
|
if my_service.total_message_limit - messages_sent < 0:
|
||||||
|
raise Exception(
|
||||||
|
f"Math error get_service_message_ratio(), \
|
||||||
|
total {my_service.total_message_limit} \
|
||||||
|
messages_sent {messages_sent} remaining {messages_remaining} \
|
||||||
|
service_id {service_id} current_year {current_year}"
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"messages_sent": messages_sent,
|
"messages_sent": messages_sent,
|
||||||
|
"messages_remaining": messages_remaining,
|
||||||
"total_message_limit": my_service.total_message_limit,
|
"total_message_limit": my_service.total_message_limit,
|
||||||
}, 200
|
}, 200
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user