From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:04:13 +0000 (-0800) Subject: Trigger reindex on comment add / delete X-Git-Tag: v1.12.1~1^2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b38aacd1ce18c4ff51adbd026a7dbfd799cf3d85;p=thirdparty%2Fpaperless-ngx.git Trigger reindex on comment add / delete --- diff --git a/src/documents/views.py b/src/documents/views.py index e2807edff0..854f2da2b0 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(