Cleanup empty instance nodes in the same task not as a separate task

This commit is contained in:
Roberto Rosario
2015-01-05 14:08:33 -04:00
parent c195f74310
commit 6737a87021
2 changed files with 2 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ def index_document(document):
for index_node in IndexInstanceNode.objects.filter(documents=document):
index_node.documents.remove(document)
delete_empty_index_nodes()
# Only update indexes where the document type is found or that do not have any document type specified
# TODO: explicit document type selection, none != all
for index in Index.objects.filter(Q(enabled=True) & (Q(document_types=None) | Q(document_types=document.document_type))):