mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Get notification count from api instead of list of notifications
when checking if job can be cancelled. This makes query lighter, less likely to fall over if job is large and removes pagination bug.
This commit is contained in:
@@ -127,5 +127,8 @@ class NotificationApiClient(NotifyAdminAPIClient):
|
||||
}
|
||||
)
|
||||
|
||||
def get_notification_count_for_job_id(self, *, service_id, job_id):
|
||||
return self.get(url='/service/{}/job/{}/notification_count'.format(service_id, job_id))["count"]
|
||||
|
||||
|
||||
notification_api_client = NotificationApiClient()
|
||||
|
||||
Reference in New Issue
Block a user