Wrap indexation in a transaction.
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
from django.db import models
|
||||
from django.db import models, transaction
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from documents.models import Document
|
||||
@@ -75,6 +75,7 @@ class IndexInstanceNodeManager(models.Manager):
|
||||
|
||||
from .models import Index
|
||||
|
||||
with transaction.atomic():
|
||||
self.remove_document(document)
|
||||
|
||||
# Only update indexes where the document type is found
|
||||
|
||||
Reference in New Issue
Block a user