Merge pull request #2617 from alphagov/notification-count-for-job

Return count of notifications in the database for a job
This commit is contained in:
Rebecca Law
2019-10-03 16:54:30 +01:00
committed by GitHub
4 changed files with 59 additions and 1 deletions

View File

@@ -178,6 +178,11 @@ def get_notifications_for_job(service_id, job_id, filter_dict=None, page=1, page
)
@statsd(namespace="dao")
def dao_get_notification_count_for_job_id(*, job_id):
return Notification.query.filter_by(job_id=job_id).count()
@statsd(namespace="dao")
def get_notification_with_personalisation(service_id, notification_id, key_type):
filter_dict = {'service_id': service_id, 'id': notification_id}