From 06e2500443b5f00553a204856a2207552c56e4c9 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Wed, 1 Feb 2023 07:23:04 -0800 Subject: [PATCH] Moves the mktime call into the if block where it is used, preventing exceptions during rare cases --- src/documents/management/commands/document_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documents/management/commands/document_exporter.py b/src/documents/management/commands/document_exporter.py index 8e8a4978c..fdea8aff6 100644 --- a/src/documents/management/commands/document_exporter.py +++ b/src/documents/management/commands/document_exporter.py @@ -311,8 +311,8 @@ class Command(BaseCommand): archive_target = None # 3.4. write files to target folder - t = int(time.mktime(document.created.timetuple())) if document.storage_type == Document.STORAGE_TYPE_GPG: + t = int(time.mktime(document.created.timetuple())) original_target.parent.mkdir(parents=True, exist_ok=True) with document.source_file as out_file: