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:
Pea Tyczynska
2019-09-24 17:27:31 +01:00
parent 4fb622f4f6
commit 9058b13ff2
4 changed files with 19 additions and 10 deletions

View File

@@ -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()