8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 19:33:11 +00:00

Fix diff computation in event logs

This commit is contained in:
Jean-Romain Garnier 2020-04-24 18:32:39 +02:00 committed by Gabriel Detraz
parent 2a4bea4bbc
commit 37ce4f74d3

View file

@ -449,7 +449,7 @@ class VersionAction(HistoryEvent):
except StopIteration: except StopIteration:
return None return None
def _compute_diff(self, v1, v2): def _compute_diff(self, v1, v2, ignoring=["pwd_ntlm"]):
""" """
Find the edited field between two versions Find the edited field between two versions
:param v1: Version :param v1: Version
@ -460,7 +460,7 @@ class VersionAction(HistoryEvent):
fields = [] fields = []
for key in v1.field_dict.keys(): for key in v1.field_dict.keys():
if v1.field_dict[key] != v2.field_dict[key]: if key not in ignoring and v1.field_dict[key] != v2.field_dict[key]:
fields.append(key) fields.append(key)
return fields return fields
@ -471,7 +471,8 @@ class RevisionAction:
def __init__(self, revision): def __init__(self, revision):
self.performed_by = revision.user self.performed_by = revision.user
self.revision = revision self.revision = revision
self.versions = [VersionAction(v) for v in revision.version_set.all() if v.is_useful()] self.versions = [VersionAction(v) for v in revision.version_set.all()]
self.versions = filter(lambda v: v.is_useful(), self.versions)
def id(self): def id(self):
return self.revision.id return self.revision.id