SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 136d6d38 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Try better exception handling in signalprocessors

parent 9dffc11b
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ def remove_objects_indexes(sender_type_id, object_type_id, object_id): ...@@ -25,7 +25,7 @@ def remove_objects_indexes(sender_type_id, object_type_id, object_id):
object_type = ContentType.objects.get_for_id(object_type_id) object_type = ContentType.objects.get_for_id(object_type_id)
try: try:
instance = object_type.get_object_for_this_type(pk=object_id) instance = object_type.get_object_for_this_type(pk=object_id)
except object_type.DoesNotExist: except object_type.model_class().DoesNotExist:
return None return None
if isinstance(instance, Submission): if isinstance(instance, Submission):
...@@ -64,7 +64,7 @@ def update_instance_indexes(sender_type_id, object_type_id, object_id): ...@@ -64,7 +64,7 @@ def update_instance_indexes(sender_type_id, object_type_id, object_id):
object_type = ContentType.objects.get_for_id(object_type_id) object_type = ContentType.objects.get_for_id(object_type_id)
try: try:
instance = object_type.get_object_for_this_type(pk=object_id) instance = object_type.get_object_for_this_type(pk=object_id)
except object_type.DoesNotExist: except object_type.model_class().DoesNotExist:
return None return None
try: try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment