Fix notification worker's use of get repo notification

This commit is contained in:
Matt Jibson 2015-08-14 15:42:31 -04:00
parent 9214289948
commit 132bc4491b

View file

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