From 132bc4491b9d6d4ba2d1396fa3ba60ca59be7a9a Mon Sep 17 00:00:00 2001 From: Matt Jibson Date: Fri, 14 Aug 2015 15:42:31 -0400 Subject: [PATCH] Fix notification worker's use of get repo notification --- workers/notificationworker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workers/notificationworker.py b/workers/notificationworker.py index 7ffe69af0..6c99e84d6 100644 --- a/workers/notificationworker.py +++ b/workers/notificationworker.py @@ -7,6 +7,7 @@ from endpoints.notificationevent import NotificationEvent, InvalidNotificationEv from workers.queueworker import QueueWorker, JobException from data import model +from data.database import RepositoryNotification logger = logging.getLogger(__name__) @@ -14,8 +15,9 @@ class NotificationWorker(QueueWorker): def process_queue_item(self, job_details): notification_uuid = job_details['notification_uuid'] - notification = model.notification.get_repo_notification(notification_uuid) - if not notification: + try: + notification = model.notification.get_repo_notification(notification_uuid) + except RepositoryNotification.DoesNotExist: # Probably deleted. return