diff --git a/mayan/apps/document_indexing/managers.py b/mayan/apps/document_indexing/managers.py index fe0477768b..8aa1f5478e 100644 --- a/mayan/apps/document_indexing/managers.py +++ b/mayan/apps/document_indexing/managers.py @@ -9,8 +9,8 @@ class DocumentIndexInstanceNodeManager(models.Manager): class IndexManager(models.Manager): - def get_by_natural_key(self, name): - return self.get(name=name) + def get_by_natural_key(self, slug): + return self.get(slug=slug) def index_document(self, document): for index in self.filter(enabled=True, document_types=document.document_type): diff --git a/mayan/apps/document_indexing/models.py b/mayan/apps/document_indexing/models.py index 78ef2ff4bc..5012a5e6ff 100644 --- a/mayan/apps/document_indexing/models.py +++ b/mayan/apps/document_indexing/models.py @@ -83,6 +83,9 @@ class Index(models.Model): def instance_root(self): return self.template_root.index_instance_nodes.get() + def natural_key(self): + return (self.slug,) + def rebuild(self): """ Delete and reconstruct the index by deleting of all its instance nodes