mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-20 06:50:58 +00:00
Improved performance of signal handlers
This commit is contained in:
parent
7a4651ad64
commit
3c3c3b6557
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ from wagtail.wagtailsearch.backends import get_search_backends
|
|||
|
||||
|
||||
def post_save_signal_handler(instance, **kwargs):
|
||||
if instance not in type(instance).get_indexed_objects():
|
||||
if not type(instance).get_indexed_objects().filter(id=instance.id).exists():
|
||||
return
|
||||
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ def post_save_signal_handler(instance, **kwargs):
|
|||
|
||||
|
||||
def post_delete_signal_handler(instance, **kwargs):
|
||||
if instance not in type(instance).get_indexed_objects():
|
||||
if not type(instance).get_indexed_objects().filter(id=instance.id).exists():
|
||||
return
|
||||
|
||||
for backend in get_search_backends():
|
||||
|
|
|
|||
Loading…
Reference in a new issue