mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-11 23:59:31 -06:00
Fix these ones
This commit is contained in:
@@ -436,11 +436,18 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
||||
tags_to_add = self.tags.model.objects.filter(id__in=tag_ids)
|
||||
self.tags.add(*tags_to_add)
|
||||
|
||||
def delete(self, using=None, *, keep_parents=False):
|
||||
def delete(
|
||||
self,
|
||||
*args,
|
||||
**kwargs,
|
||||
):
|
||||
# If deleting a head document, move all versions to trash as well.
|
||||
if self.head_version_id is None:
|
||||
Document.objects.filter(head_version=self).delete()
|
||||
return super().delete(using=using, keep_parents=keep_parents)
|
||||
return super().delete(
|
||||
*args,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
|
||||
class SavedView(ModelWithOwner):
|
||||
|
||||
Reference in New Issue
Block a user