8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Don't assume an event's userfulness when showing logs

This commit is contained in:
Jean-Romain Garnier 2020-04-24 23:51:57 +02:00 committed by chirac
parent 0c7689adde
commit 301a8f0182

View file

@ -421,11 +421,6 @@ class VersionAction(HistoryEvent):
def __init__(self, version):
self.version = version
def is_useful(self):
# Some versions are duplicates, and don't have a reference
# to any object, so ignore them
return self.version.object_id is not None
def name(self):
return "{} {}".format(self.model_name().title(), self.version.object_repr)
@ -490,7 +485,6 @@ class RevisionAction:
self.performed_by = revision.user
self.revision = revision
self.versions = [VersionAction(v) for v in revision.version_set.all()]
self.versions = filter(lambda v: v.is_useful(), self.versions)
def id(self):
return self.revision.id