Skip to content

Commit

Permalink
order rr references by id
Browse files Browse the repository at this point in the history
make order for reference records returned by `rr_get_references()`
persistent by sorting them by their `id` attribute

this makes `RRReferencesTest::test_get_references` work, see 1and1#198
  • Loading branch information
zeromind committed Feb 8, 2022
1 parent 2c94a08 commit 34d146e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dim/dim/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2622,7 +2622,7 @@ def rr_object(rr):
not (not delete and ref.type not in IP_RELATED and rr.type not in IP_RELATED and root.type in IP_RELATED):
nodes.append(ref)
graph[rr.id].append(ref.id)
return {'records': [rr_object(records[r]) for r in records], 'graph': graph, 'root': root.id}
return {'records': sorted([rr_object(records[r]) for r in records], key=lambda x: x['id']), 'graph': graph, 'root': root.id}

@updating
def rr_edit(self, id, views=None, references=None, **kwargs):
Expand Down

0 comments on commit 34d146e

Please sign in to comment.