Explicit document type needes to trigger indexing of documents, previously indexes with no document type associated would update for all document types
This commit is contained in:
@@ -45,6 +45,8 @@ What's new in Mayan EDMS v1.1
|
||||
* Watch folders
|
||||
* Removal of the duplicate document search support
|
||||
* Removal of filesystem document indexes mirroring
|
||||
* New home view
|
||||
* Explicit document types needed per index
|
||||
|
||||
|
||||
Upgrading from a previous version
|
||||
|
||||
@@ -25,9 +25,8 @@ def index_document(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))):
|
||||
# Only update indexes where the document type is found
|
||||
for index in Index.objects.filter(enabled=True, document_types=document.document_type):
|
||||
root_instance, created = IndexInstanceNode.objects.get_or_create(index_template_node=index.template_root, parent=None)
|
||||
for template_node in index.template_root.get_children():
|
||||
index_warnings = cascade_eval(document, template_node, root_instance)
|
||||
|
||||
@@ -44,8 +44,7 @@ class Index(models.Model):
|
||||
IndexTemplateNode.objects.get_or_create(parent=None, index=self)
|
||||
|
||||
def get_document_types_names(self):
|
||||
# TODO: explicit document type selection, none != all
|
||||
return u', '.join([unicode(document_type) for document_type in self.document_types.all()] or [u'All'])
|
||||
return u', '.join([unicode(document_type) for document_type in self.document_types.all()] or [u'None'])
|
||||
|
||||
def natural_key(self):
|
||||
return (self.name,)
|
||||
|
||||
Reference in New Issue
Block a user