SciPost Code Repository

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

Try patch of celery

parent 060d874e
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,10 @@ def remove_objects_indexes(sender_type_id, object_type_id, object_id):
"""
sender = ContentType.objects.get_for_id(sender_type_id)
object_type = ContentType.objects.get_for_id(object_type_id)
instance = object_type.get_object_for_this_type(pk=object_id)
try:
instance = object_type.get_object_for_this_type(pk=object_id)
except object_type.DoesNotExist:
return None
if isinstance(instance, Submission):
# Submission have complex status handling, so a status change should lead to
......@@ -59,7 +62,10 @@ def update_instance_indexes(sender_type_id, object_type_id, object_id):
"""
sender = ContentType.objects.get_for_id(sender_type_id)
object_type = ContentType.objects.get_for_id(object_type_id)
instance = object_type.get_object_for_this_type(pk=object_id)
try:
instance = object_type.get_object_for_this_type(pk=object_id)
except object_type.DoesNotExist:
return None
try:
using_backends = connection_router.for_write(instance=instance)
......
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