A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix: lazy import guardian modules to fix search language setting (#13768)
shamoonbab9129ff8ed
diff --git a/src/documents/search/_backend.py b/src/documents/search/_backend.pyindex 8aaa6cccd..b783cfd2d 100644--- a/src/documents/search/_backend.py+++ b/src/documents/search/_backend.py@@ -20,10 +20,7 @@ from typing import castimport filelockimport tantivyfrom django.conf import settings-from django.contrib.contenttypes.models import ContentTypefrom django.utils.timezone import get_current_timezone-from guardian.shortcuts import get_groups_with_perms-from guardian.shortcuts import get_users_with_permsfrom documents.search._query import build_permission_filterfrom documents.search._query import extract_cjk_text@@ -429,6 +426,9 @@ class TantivyBackend:Annotate the queryset with ``annotate_effective_content`` when indexingmore than a couple of documents, to resolve that without a query each."""+ from guardian.shortcuts import get_groups_with_perms+ from guardian.shortcuts import get_users_with_perms+content = document.get_effective_content() or ""doc = tantivy.Document()@@ -1082,6 +1082,7 @@ def _bulk_get_viewer_permissions("""from collections import defaultdict+ from django.contrib.contenttypes.models import ContentTypefrom guardian.models import GroupObjectPermissionfrom guardian.models import UserObjectPermission