changed the way public filenames (i.e., for download and exporting) are generated. #94

This commit is contained in:
jonaswinkler
2020-12-06 19:03:45 +01:00
parent 655ce81cb6
commit 7f1671ac2d
6 changed files with 55 additions and 34 deletions

View File

@@ -157,7 +157,7 @@ def run_post_consume_script(sender, document, **kwargs):
Popen((
settings.POST_CONSUME_SCRIPT,
str(document.pk),
document.file_name,
document.get_public_filename(),
os.path.normpath(document.source_path),
os.path.normpath(document.thumbnail_path),
reverse("document-download", kwargs={"pk": document.pk}),
@@ -179,7 +179,7 @@ def cleanup_document_deletion(sender, instance, using, **kwargs):
f"Deleted file {f}.")
except OSError as e:
logging.getLogger(__name__).warning(
f"While deleting document {instance.file_name}, the file "
f"While deleting document {str(instance)}, the file "
f"{f} could not be deleted: {e}"
)