]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: use hard delete for custom fields with workflow removal (#10191)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 16 Jun 2025 14:09:22 +0000 (07:09 -0700)
committerGitHub <noreply@github.com>
Mon, 16 Jun 2025 14:09:22 +0000 (07:09 -0700)
src/documents/signals/handlers.py

index 2d233ff4bcafd8fa5f987652e9905217bf3a1847..815a604bba73c372bbc430cf723fa31bc195816e 100644 (file)
@@ -1021,7 +1021,7 @@ def run_workflows(
 
         if action.remove_all_custom_fields:
             if not use_overrides:
-                CustomFieldInstance.objects.filter(document=document).delete()
+                CustomFieldInstance.objects.filter(document=document).hard_delete()
             else:
                 overrides.custom_fields = None
         elif action.remove_custom_fields.exists():
@@ -1029,7 +1029,7 @@ def run_workflows(
                 CustomFieldInstance.objects.filter(
                     field__in=action.remove_custom_fields.all(),
                     document=document,
-                ).delete()
+                ).hard_delete()
             elif overrides.custom_fields:
                 for field in action.remove_custom_fields.filter(
                     pk__in=overrides.custom_fields.keys(),