From 6d8ffa33821009e5227aca9f53b08f6270bdd5b9 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:14:58 -0700 Subject: [PATCH] Moves this to the more standard Django location --- src/documents/checks.py | 2 +- src/documents/file_handling.py | 4 ++-- src/documents/migrations/1055_alter_storagepath_path.py | 2 +- src/documents/templatetags/__init__.py | 0 src/documents/{templatetags.py => templatetags/filepath.py} | 0 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 src/documents/templatetags/__init__.py rename src/documents/{templatetags.py => templatetags/filepath.py} (100%) diff --git a/src/documents/checks.py b/src/documents/checks.py index 2de1572c8..ef6f4e845 100644 --- a/src/documents/checks.py +++ b/src/documents/checks.py @@ -9,7 +9,7 @@ from django.db.utils import OperationalError from django.db.utils import ProgrammingError from documents.signals import document_consumer_declaration -from documents.templatetags import convert_to_django_template_format +from documents.templatetags.filepath import convert_to_django_template_format @register() diff --git a/src/documents/file_handling.py b/src/documents/file_handling.py index eb1397f7d..1b0baf0d4 100644 --- a/src/documents/file_handling.py +++ b/src/documents/file_handling.py @@ -17,7 +17,7 @@ from documents.models import Document from documents.models import DocumentType from documents.models import StoragePath from documents.models import Tag -from documents.templatetags import convert_to_django_template_format +from documents.templatetags.filepath import convert_to_django_template_format logger = logging.getLogger("paperless.filehandling") @@ -26,7 +26,7 @@ INVALID_VARIABLE_STR = "InvalidVarError" filepath_engine = Engine( autoescape=False, string_if_invalid=f"{INVALID_VARIABLE_STR}: %s", - libraries={"filepath": "documents.templatetags"}, + libraries={"filepath": "documents.templatetags.filepath"}, ) diff --git a/src/documents/migrations/1055_alter_storagepath_path.py b/src/documents/migrations/1055_alter_storagepath_path.py index ca3d05d41..134a26c7f 100644 --- a/src/documents/migrations/1055_alter_storagepath_path.py +++ b/src/documents/migrations/1055_alter_storagepath_path.py @@ -10,7 +10,7 @@ def convert_from_format_to_template(apps, schema_editor): StoragePath = apps.get_model("documents", "StoragePath") - from documents.templatetags import convert_to_django_template_format + from documents.templatetags.filepath import convert_to_django_template_format with transaction.atomic(): for storage_path in StoragePath.objects.all(): diff --git a/src/documents/templatetags/__init__.py b/src/documents/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/documents/templatetags.py b/src/documents/templatetags/filepath.py similarity index 100% rename from src/documents/templatetags.py rename to src/documents/templatetags/filepath.py