Merge pull request #366 from mjibson/fix-notification-get-repo

Fix notification worker's use of get repo notification
This commit is contained in:
Jimmy Zelinskie 2015-08-14 15:45:47 -04:00
commit 3a5eb40563

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