mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-17 11:41:11 +00:00
Make search signal handlers use get_indexed_objects
This commit is contained in:
parent
9bf6c18726
commit
b4fdec74ac
1 changed files with 7 additions and 0 deletions
|
|
@ -6,11 +6,18 @@ from wagtail.wagtailsearch.backends import get_search_backends
|
|||
|
||||
|
||||
def post_save_signal_handler(instance, **kwargs):
|
||||
if instance not in type(instance).get_indexed_objects():
|
||||
return
|
||||
|
||||
|
||||
for backend in get_search_backends():
|
||||
backend.add(instance)
|
||||
|
||||
|
||||
def post_delete_signal_handler(instance, **kwargs):
|
||||
if instance not in type(instance).get_indexed_objects():
|
||||
return
|
||||
|
||||
for backend in get_search_backends():
|
||||
backend.delete(instance)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue