mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-19 14:28:14 +00:00
Tweakhancement: show file extension in StoragePath test (#12452)
This commit is contained in:
1 parent
9383471fa0
commit
129da3ade7
2 files changed
+40
-14
No files matched your search
@@ -3290,6 +3290,12 @@ class StoragePathViewSet(PermissionsAwareDocumentCountMixin, ModelViewSet):
|
||||
path = serializer.validated_data.get("path")
|
||||
|
||||
result = format_filename(document, path)
|
||||
if result:
|
||||
extension = (
|
||||
Path(str(document.filename)).suffix if document.filename else ""
|
||||
) or document.file_type
|
||||
result_path = Path(result)
|
||||
result = str(result_path.with_name(f"{result_path.name}{extension}"))
|
||||
return Response(result)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user