Skip to content

Commit f6bf373

Browse files
committed
[fix] Change floorplan coordinates to (y,x)
1 parent 7860e87 commit f6bf373

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

openwisp_controller/geo/api/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class FloorplanCoordinatesSerializer(serializers.ModelSerializer):
363363

364364
class Meta:
365365
model = DeviceLocation
366-
fields = (
366+
fields = [
367367
"name",
368368
"mac_address",
369369
"is_deactivated",
@@ -373,7 +373,7 @@ class Meta:
373373
"floor",
374374
"image",
375375
"location",
376-
)
376+
]
377377

378378
def get_floor_name(self, obj):
379379
loc_name = obj.floorplan.location.name
@@ -389,5 +389,5 @@ def get_location(self, obj):
389389
detail={"indoor": _("Floorplan indoor cordinates is null")}
390390
)
391391

392-
x, y = obj.indoor.split(",", 1)
392+
y, x = obj.indoor.split(",", 1)
393393
return {"lat": float(y), "lng": float(x)}

openwisp_controller/geo/api/views.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ def get_queryset(self):
217217
qs = qs.filter(location__id=location_id)
218218
return qs
219219

220-
def list(self, request, *args, **kwargs):
221-
serializer = self.get_serializer(self.get_queryset(), many=True)
222-
return Response({"nodes": serializer.data, "links": []})
223-
224220

225221
class LocationDeviceList(
226222
FilterByParentManaged, ProtectedAPIMixin, generics.ListAPIView

0 commit comments

Comments
 (0)