Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Trigger reindex on comment add / delete

Michael Shamoonb38aacd1ce18
diff --git a/src/documents/views.py b/src/documents/views.py
index e2807edff..854f2da2b 100644
--- a/src/documents/views.py
+++ b/src/documents/views.py
@@ -445,6 +445,10 @@ class DocumentViewSet(
)
c.save()
+ from documents import index
+
+ index.add_or_update_document(self.get_object())
+
return Response(self.getComments(doc))
except Exception as e:
logger.warning(f"An error occurred saving comment: {str(e)}")
@@ -456,6 +460,11 @@ class DocumentViewSet(
elif request.method == "DELETE":
comment = Comment.objects.get(id=int(request.GET.get("id")))
comment.delete()
+
+ from documents import index
+
+ index.add_or_update_document(self.get_object())
+
return Response(self.getComments(doc))
return Response(