A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix: During a move to the trash directory, attempt to copy metadata, but don't let it fail the move (#14250)
Trenton H2a44d8b5ba93
diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.pyindex ec3f3778c..53acf75ba 100644--- a/src/documents/signals/handlers.py+++ b/src/documents/signals/handlers.py@@ -56,6 +56,7 @@ from documents.permissions import get_objects_for_user_owner_awarefrom documents.plugins.helpers import DocumentsStatusManagerfrom documents.templating.utils import convert_format_str_to_template_formatfrom documents.utils import compute_checksum+from documents.utils import copy_file_with_basic_statsfrom documents.workflows.actions import build_workflow_action_contextfrom documents.workflows.actions import execute_email_actionfrom documents.workflows.actions import execute_move_to_trash_action@@ -363,7 +364,11 @@ def cleanup_document_deletion(sender, instance, **kwargs) -> None:logger.debug(f"Moving {instance.source_path} to trash at {new_file_path}")try:- shutil.move(instance.source_path, new_file_path)+ shutil.move(+ instance.source_path,+ new_file_path,+ copy_function=copy_file_with_basic_stats,+ )except OSError as e:logger.error(f"Failed to move {instance.source_path} to trash at "