From 63cb75564e2575e1cc33db32c5413c602e498903 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:04:51 -0700 Subject: [PATCH] Chore: Remove some further old items (encryption passphrase and PNG handling) (#12290) --- scripts/post-consumption-example.sh | 2 -- .../management/commands/document_importer.py | 21 ++++-------------- .../management/commands/loaddata_stdin.py | 22 ------------------- .../tests/test_management_exporter.py | 4 ---- 4 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 src/documents/management/commands/loaddata_stdin.py diff --git a/scripts/post-consumption-example.sh b/scripts/post-consumption-example.sh index fbcd0b4cf..00517321a 100755 --- a/scripts/post-consumption-example.sh +++ b/scripts/post-consumption-example.sh @@ -19,6 +19,4 @@ following additional information about it: * Correspondent: ${DOCUMENT_CORRESPONDENT} * Tags: ${DOCUMENT_TAGS} -It was consumed with the passphrase ${PASSPHRASE} - " diff --git a/src/documents/management/commands/document_importer.py b/src/documents/management/commands/document_importer.py index fd6941213..20d50e41b 100644 --- a/src/documents/management/commands/document_importer.py +++ b/src/documents/management/commands/document_importer.py @@ -33,7 +33,6 @@ from documents.models import Document from documents.models import DocumentType from documents.models import Note from documents.models import Tag -from documents.parsers import run_convert from documents.settings import EXPORTER_ARCHIVE_NAME from documents.settings import EXPORTER_CRYPTO_SETTINGS_NAME from documents.settings import EXPORTER_FILE_NAME @@ -403,22 +402,10 @@ class Command(CryptMixin, PaperlessCommand): copy_file_with_basic_stats(document_path, document.source_path) if thumbnail_path: - if thumbnail_path.suffix in {".png", ".PNG"}: - run_convert( - density=300, - scale="500x5000>", - alpha="remove", - strip=True, - trim=False, - auto_orient=True, - input_file=f"{thumbnail_path}[0]", - output_file=str(document.thumbnail_path), - ) - else: - copy_file_with_basic_stats( - thumbnail_path, - document.thumbnail_path, - ) + copy_file_with_basic_stats( + thumbnail_path, + document.thumbnail_path, + ) if archive_path: create_source_path_directory(document.archive_path) diff --git a/src/documents/management/commands/loaddata_stdin.py b/src/documents/management/commands/loaddata_stdin.py deleted file mode 100644 index f6feb2e8d..000000000 --- a/src/documents/management/commands/loaddata_stdin.py +++ /dev/null @@ -1,22 +0,0 @@ -import sys - -from django.core.management.commands.loaddata import Command as LoadDataCommand - - -# This class is used to migrate data between databases -# That's difficult to test -class Command(LoadDataCommand): # pragma: no cover - """ - Allow the loading of data from standard in. Sourced originally from: - https://gist.github.com/bmispelon/ad5a2c333443b3a1d051 (MIT licensed) - """ - - def parse_name(self, fixture_name): - self.compression_formats["stdin"] = (lambda x, y: sys.stdin, None) - if fixture_name == "-": - return "-", "json", "stdin" - - def find_fixtures(self, fixture_label): - if fixture_label == "-": - return [("-", None, "-")] - return super().find_fixtures(fixture_label) diff --git a/src/documents/tests/test_management_exporter.py b/src/documents/tests/test_management_exporter.py index fb41bfa07..6cd8cd729 100644 --- a/src/documents/tests/test_management_exporter.py +++ b/src/documents/tests/test_management_exporter.py @@ -147,7 +147,6 @@ class TestExportImport( else: raise ValueError(f"document with id {id} does not exist in manifest") - @override_settings(PASSPHRASE="test") def _do_export( self, *, @@ -441,7 +440,6 @@ class TestExportImport( ) self.assertRaises(FileNotFoundError, call_command, "document_exporter", target) - @override_settings(PASSPHRASE="test") def test_export_zipped(self) -> None: """ GIVEN: @@ -473,7 +471,6 @@ class TestExportImport( self.assertIn("manifest.json", zip.namelist()) self.assertIn("metadata.json", zip.namelist()) - @override_settings(PASSPHRASE="test") def test_export_zipped_format(self) -> None: """ GIVEN: @@ -510,7 +507,6 @@ class TestExportImport( self.assertIn("manifest.json", zip.namelist()) self.assertIn("metadata.json", zip.namelist()) - @override_settings(PASSPHRASE="test") def test_export_zipped_with_delete(self) -> None: """ GIVEN: