Fix: enforce path limit for db filename fields (#12235)

This commit is contained in:
shamoon authored and GitHub committed 2026-03-03 13:19:56 -08:00
1 parent c7f83212a3
commit 8b8307571a
6 files changed
+107 -15

No files matched your search

+11 -7
View File
@@ -128,17 +128,21 @@ def generate_filename(
counter=0,
append_gpg=True,
archive_filename=False,
use_format=True,
) -> Path:
base_path: Path | None = None
# Determine the source of the format string
if doc.storage_path is not None:
filename_format = doc.storage_path.path
elif settings.FILENAME_FORMAT is not None:
# Maybe convert old to new style
filename_format = convert_format_str_to_template_format(
settings.FILENAME_FORMAT,
)
if use_format:
if doc.storage_path is not None:
filename_format = doc.storage_path.path
elif settings.FILENAME_FORMAT is not None:
# Maybe convert old to new style
filename_format = convert_format_str_to_template_format(
settings.FILENAME_FORMAT,
)
else:
filename_format = None
else:
filename_format = None