Fixingon_new_history_entry signals

remotes/origin/issue/4795/notification_even_they_are_disabled
Alejandro Alonso 2016-02-10 10:44:41 +01:00 committed by David Barragán Merino
parent e26f3d1657
commit 52a497eb6c
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ def on_new_history_entry(sender, instance, created, **kwargs):
model = history_service.get_model_from_key(instance.key) model = history_service.get_model_from_key(instance.key)
pk = history_service.get_pk_from_key(instance.key) pk = history_service.get_pk_from_key(instance.key)
obj = model.objects.get(pk=pk) try:
obj = model.objects.get(pk=pk)
except model.DoesNotExist:
# Catch simultaneous DELETE request
return None
webhooks = _get_project_webhooks(obj.project) webhooks = _get_project_webhooks(obj.project)