Fix these ones

This commit is contained in:
shamoon
2026-02-10 13:52:20 -08:00
parent 5dd2e1040d
commit b676397b80

View File

@@ -436,11 +436,18 @@ class Document(SoftDeleteModel, ModelWithOwner):
tags_to_add = self.tags.model.objects.filter(id__in=tag_ids) tags_to_add = self.tags.model.objects.filter(id__in=tag_ids)
self.tags.add(*tags_to_add) 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 deleting a head document, move all versions to trash as well.
if self.head_version_id is None: if self.head_version_id is None:
Document.objects.filter(head_version=self).delete() Document.objects.filter(head_version=self).delete()
return super().delete(using=using, keep_parents=keep_parents) return super().delete(
*args,
**kwargs,
)
class SavedView(ModelWithOwner): class SavedView(ModelWithOwner):