exclude deleted created objects from relevant_changes() query
This commit is contained in:
parent
959e0adfa0
commit
400eeadf53
1 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,9 @@ class ChangeSet(models.Model):
|
|||
self._last_change_pk = 0
|
||||
|
||||
def relevant_changes(self):
|
||||
return self.changes.filter(discarded_by__isnull=True).exclude(action='restore')
|
||||
qs = self.changes.filter(discarded_by__isnull=True).exclude(action='restore')
|
||||
qs = qs.exclude(action='delete', created_object_id__isnull=False)
|
||||
return qs
|
||||
|
||||
def parse_changes(self, get_history=False):
|
||||
if self.pk is None or self.changes_qs is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue