8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-09 03:16:25 +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 Jean-Romain Garnier
parent 72dbdee0b5
commit 530d5dc6f1

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