Skip to content

Commit

Permalink
Exclude self-loops from map link JSON (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Dickinson authored Dec 24, 2024
1 parent 615e619 commit 7f6961a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions src/meshapi/tests/test_map_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,6 @@ def test_link_data(self):
"to": 123,
"status": "planned",
},
{
"from": 1934,
"installDate": 1706245200000,
"status": "60GHz",
"to": 1934,
},
{
"from": 56789,
"to": 123,
Expand Down
1 change: 1 addition & 0 deletions src/meshapi/views/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class MapDataLinkList(generics.ListAPIView):
Link.objects.exclude(status__in=[Link.LinkStatus.INACTIVE])
.exclude(to_device__node__status=Node.NodeStatus.INACTIVE)
.exclude(from_device__node__status=Node.NodeStatus.INACTIVE)
.exclude(from_device__node__network_number=F("to_device__node__network_number"))
.prefetch_related("to_device__node")
.prefetch_related("from_device__node")
.filter(
Expand Down

0 comments on commit 7f6961a

Please sign in to comment.