mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-02 13:22:17 +00:00
Fixed versioning UI for revisions containing multiple event versions, hopefully
This commit is contained in:
@@ -119,17 +119,19 @@ def compare_event_items(old, new):
|
|||||||
# Build some dicts of what we have
|
# Build some dicts of what we have
|
||||||
item_dict = {} # build a list of items, key is the item_pk
|
item_dict = {} # build a list of items, key is the item_pk
|
||||||
for version in old_item_versions: # put all the old versions in a list
|
for version in old_item_versions: # put all the old versions in a list
|
||||||
compare = ItemCompare(old=version.object_version.object)
|
if version.object_version.object.event.id == old.object_id:
|
||||||
item_dict[version.object_id] = compare
|
compare = ItemCompare(old=version.object_version.object)
|
||||||
|
item_dict[version.object_id] = compare
|
||||||
|
|
||||||
for version in new_item_versions: # go through the new versions
|
for version in new_item_versions: # go through the new versions
|
||||||
try:
|
if version.object_version.object.event.id == new.object_id:
|
||||||
compare = item_dict[version.object_id] # see if there's a matching old version
|
try:
|
||||||
compare.new = version.object_version.object # then add the new version to the dictionary
|
compare = item_dict[version.object_id] # see if there's a matching old version
|
||||||
except KeyError: # there's no matching old version, so add this item to the dictionary by itself
|
compare.new = version.object_version.object # then add the new version to the dictionary
|
||||||
compare = ItemCompare(new=version.object_version.object)
|
except KeyError: # there's no matching old version, so add this item to the dictionary by itself
|
||||||
|
compare = ItemCompare(new=version.object_version.object)
|
||||||
|
|
||||||
item_dict[version.object_id] = compare # update the dictionary with the changes
|
item_dict[version.object_id] = compare # update the dictionary with the changes
|
||||||
|
|
||||||
changes = []
|
changes = []
|
||||||
for (_, compare) in item_dict.items():
|
for (_, compare) in item_dict.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user