celery-haystack icon indicating copy to clipboard operation
celery-haystack copied to clipboard

When the signal is triggered, the index_queryset is ignored

Open rafaponieman opened this issue 11 years ago • 4 comments

Lets say there is a CelerySearchIndex that specifies a reduced index_queryset. Then, the update/delete signal will be called for ANY instance of that model, not restricted to the specified index_queryset. So, when get_instance is called, if the model instance is not included in its manager's default queryset, celery haystack can't find it triggering two errors:

Task celery_haystack.tasks.CeleryHaystackSignalHandler[bff705bb-68fc-4f26-854b-bfde98024014]raised exception: ValueError(u"Couldn't load object '... you model instance...'",)

And

Couldn't load ... you model instance... Somehow it went missing?

rafaponieman avatar May 22 '14 16:05 rafaponieman

Same here, fixed it by overriding should_update and checking if the instance is in the queryset

rasca avatar Apr 24 '15 14:04 rasca

This is still happening as of 2016-05-22

rasca avatar May 23 '16 00:05 rasca

querysets can be millions of items long :/

yeago avatar May 26 '16 20:05 yeago

any idea on how to handle this issue because it keeps repeating again and again? thank you!

mpetyx avatar Oct 03 '16 14:10 mpetyx