Fix notification worker's use of get repo notification
This commit is contained in:
		
							parent
							
								
									9214289948
								
							
						
					
					
						commit
						132bc4491b
					
				
					 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 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 | ||||
| 
 | ||||
|  |  | |||
		Reference in a new issue