mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Trigger reindex on comment add / delete
This commit is contained in:
		
							parent
							
								
									75d2a3a45f
								
							
						
					
					
						commit
						b38aacd1ce
					
				@ -445,6 +445,10 @@ class DocumentViewSet(
 | 
				
			|||||||
                )
 | 
					                )
 | 
				
			||||||
                c.save()
 | 
					                c.save()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                from documents import index
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                index.add_or_update_document(self.get_object())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return Response(self.getComments(doc))
 | 
					                return Response(self.getComments(doc))
 | 
				
			||||||
            except Exception as e:
 | 
					            except Exception as e:
 | 
				
			||||||
                logger.warning(f"An error occurred saving comment: {str(e)}")
 | 
					                logger.warning(f"An error occurred saving comment: {str(e)}")
 | 
				
			||||||
@ -456,6 +460,11 @@ class DocumentViewSet(
 | 
				
			|||||||
        elif request.method == "DELETE":
 | 
					        elif request.method == "DELETE":
 | 
				
			||||||
            comment = Comment.objects.get(id=int(request.GET.get("id")))
 | 
					            comment = Comment.objects.get(id=int(request.GET.get("id")))
 | 
				
			||||||
            comment.delete()
 | 
					            comment.delete()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            from documents import index
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            index.add_or_update_document(self.get_object())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Response(self.getComments(doc))
 | 
					            return Response(self.getComments(doc))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return Response(
 | 
					        return Response(
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user