mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-28 15:42:25 +00:00
Fix diff computation in event logs
This commit is contained in:
parent
7c0fcb8029
commit
968551e50b
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue