mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 00:13:12 +00:00
Fix InterfaceHistory.get
This commit is contained in:
parent
f6fdaa7007
commit
e0d0be2c9b
1 changed files with 6 additions and 6 deletions
|
@ -457,22 +457,22 @@ class InterfaceHistoryEvent(HistoryEvent):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class InterfaceHistory:
|
class InterfaceHistory(History):
|
||||||
def get(self, interface_id):
|
def get(self, interface):
|
||||||
"""
|
"""
|
||||||
:param interface_id: Interface, the interface to lookup
|
:param interface: Interface, the interface to lookup
|
||||||
:return: list or None, a list of InterfaceHistoryEvent, in reverse chronological order
|
:return: list or None, a list of InterfaceHistoryEvent, in reverse chronological order
|
||||||
"""
|
"""
|
||||||
self.events = []
|
self.events = []
|
||||||
|
|
||||||
# Get all the versions for this interface, with the oldest first
|
# Get all the versions for this interface, with the oldest first
|
||||||
self._last_version = None
|
self._last_version = None
|
||||||
user_versions = filter(
|
interface_versions = filter(
|
||||||
lambda x: x.field_dict["id"] == interface_id,
|
lambda x: x.field_dict["id"] == interface.id,
|
||||||
Version.objects.get_for_model(Interface).order_by("revision__date_created")
|
Version.objects.get_for_model(Interface).order_by("revision__date_created")
|
||||||
)
|
)
|
||||||
|
|
||||||
for version in user_versions:
|
for version in interface_versions:
|
||||||
self._add_revision(version)
|
self._add_revision(version)
|
||||||
|
|
||||||
return self.events[::-1]
|
return self.events[::-1]
|
||||||
|
|
Loading…
Reference in a new issue