Merge pull request #366 from mjibson/fix-notification-get-repo
Fix notification worker's use of get repo notification
This commit is contained in:
commit
3a5eb40563
1 changed files with 4 additions and 2 deletions
|
@ -7,6 +7,7 @@ from endpoints.notificationevent import NotificationEvent, InvalidNotificationEv
|
||||||
from workers.queueworker import QueueWorker, JobException
|
from workers.queueworker import QueueWorker, JobException
|
||||||
|
|
||||||
from data import model
|
from data import model
|
||||||
|
from data.database import RepositoryNotification
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,8 +15,9 @@ class NotificationWorker(QueueWorker):
|
||||||
def process_queue_item(self, job_details):
|
def process_queue_item(self, job_details):
|
||||||
notification_uuid = job_details['notification_uuid']
|
notification_uuid = job_details['notification_uuid']
|
||||||
|
|
||||||
notification = model.notification.get_repo_notification(notification_uuid)
|
try:
|
||||||
if not notification:
|
notification = model.notification.get_repo_notification(notification_uuid)
|
||||||
|
except RepositoryNotification.DoesNotExist:
|
||||||
# Probably deleted.
|
# Probably deleted.
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Reference in a new issue