|
20 | 20 | from django.core.files.storage import default_storage |
21 | 21 | from django.core.mail import send_mail |
22 | 22 | from django.db import models, transaction |
23 | | -from django.db.models import signals |
24 | 23 | from django.db.models.functions import Left, Length |
25 | | -from django.dispatch import receiver |
26 | 24 | from django.template.loader import render_to_string |
27 | 25 | from django.utils import timezone |
28 | 26 | from django.utils.functional import cached_property |
|
41 | 39 | RoleChoices, |
42 | 40 | get_equivalent_link_definition, |
43 | 41 | ) |
44 | | -from .tasks.find import trigger_document_indexer |
45 | 42 | from .validators import sub_validator |
46 | 43 |
|
47 | 44 | logger = getLogger(__name__) |
@@ -950,16 +947,6 @@ def restore(self): |
950 | 947 | ) |
951 | 948 |
|
952 | 949 |
|
953 | | -@receiver(signals.post_save, sender=Document) |
954 | | -def document_post_save(sender, instance, **kwargs): # pylint: disable=unused-argument |
955 | | - """ |
956 | | - Asynchronous call to the document indexer at the end of the transaction. |
957 | | - Note : Within the transaction we can have an empty content and a serialization |
958 | | - error. |
959 | | - """ |
960 | | - trigger_document_indexer(instance, on_commit=True) |
961 | | - |
962 | | - |
963 | 950 | class LinkTrace(BaseModel): |
964 | 951 | """ |
965 | 952 | Relation model to trace accesses to a document via a link by a logged-in user. |
@@ -1185,15 +1172,6 @@ def get_abilities(self, user): |
1185 | 1172 | } |
1186 | 1173 |
|
1187 | 1174 |
|
1188 | | -@receiver(signals.post_save, sender=DocumentAccess) |
1189 | | -def document_access_post_save(sender, instance, created, **kwargs): # pylint: disable=unused-argument |
1190 | | - """ |
1191 | | - Asynchronous call to the document indexer at the end of the transaction. |
1192 | | - """ |
1193 | | - if not created: |
1194 | | - trigger_document_indexer(instance.document, on_commit=True) |
1195 | | - |
1196 | | - |
1197 | 1175 | class DocumentAskForAccess(BaseModel): |
1198 | 1176 | """Relation model to ask for access to a document.""" |
1199 | 1177 |
|
|
0 commit comments