Skip to content
Snippets Groups Projects
Commit ab46003c authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

when AUTO_UPDATE_ENABLED is not enabled, make the index as needed to be rebuilt

parent 3ffaff08
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,10 @@ from autocomplete_multi_models import business_process, utils ...@@ -2,8 +2,10 @@ from autocomplete_multi_models import business_process, utils
def instance_update(sender, instance, field_names, **kwargs): def instance_update(sender, instance, field_names, **kwargs):
if business_process.get_setting_from_storage(utils.AUTO_UPDATE_ENABLED, True): if business_process.get_setting_from_storage(utils.AUTO_UPDATE_ENABLED, "True") == "True":
business_process.add_instance_to_index(instance, field_names) business_process.add_instance_to_index(instance, field_names)
else:
business_process.set_setting_in_storage(utils.REBUILD_NEEDED, True)
def instance_delete(sender, instance, field_names, **kwargs): def instance_delete(sender, instance, field_names, **kwargs):
......
[metadata] [metadata]
name = autocomplete-multi-models name = autocomplete-multi-models
version = 0.5 version = 0.5.1
description = An app that index fields across multiple models, and expose an api to query for word similar to the query. description = An app that index fields across multiple models, and expose an api to query for word similar to the query.
long_description = file: README.md long_description = file: README.md
author = Bryan Brancotte author = Bryan Brancotte
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment