Skip to content

Commit d3ca54d

Browse files
committed
[change] Change to double quotes
1 parent 2bc4e4c commit d3ca54d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

openwisp_controller/geo/api/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Meta(OrganizationManagedFilter.Meta):
5454
class DeviceFloorplanCoordinatesFilter(OrganizationManagedFilter):
5555
class Meta(OrganizationManagedFilter.Meta):
5656
model = Location
57-
fields = OrganizationManagedFilter.Meta.fields + ['floorplan__floor']
57+
fields = OrganizationManagedFilter.Meta.fields + ["floorplan__floor"]
5858

5959

6060
class ListViewPagination(pagination.PageNumberPagination):
@@ -206,8 +206,8 @@ class DeviceFloorplanCoordinatesList(ProtectedAPIMixin, generics.ListAPIView):
206206
)
207207

208208
def get_queryset(self):
209-
location_id = self.kwargs.get('pk')
210-
floor = self.request.query_params.get('floor')
209+
location_id = self.kwargs.get("pk")
210+
floor = self.request.query_params.get("floor")
211211
queryset = super().get_queryset().filter(location_id=location_id)
212212
if floor:
213213
queryset = queryset.filter(floorplan__floor=floor)
@@ -217,7 +217,7 @@ def list(self, request, *args, **kwargs):
217217
queryset = self.get_queryset()
218218
serializer = self.get_serializer(queryset, many=True)
219219
available_floors = queryset.values_list(
220-
'floorplan__floor', flat=True
220+
"floorplan__floor", flat=True
221221
).distinct()
222222
return Response(
223223
{"devices": serializer.data, "available_floors": list(available_floors)}

openwisp_controller/geo/tests/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,14 +1036,14 @@ def test_deactivated_device(self):
10361036

10371037
def test_floorplan_coordinates(self):
10381038
org = self._create_org()
1039-
location = self._create_location(type='indoor', organization=org)
1039+
location = self._create_location(type="indoor", organization=org)
10401040
floor1 = self._create_floorplan(floor=1, location=location)
10411041
floor2 = self._create_floorplan(floor=2, location=location)
10421042
device1 = self._create_device(
1043-
name='device1', mac_address='00:00:00:00:00:01', organization=org
1043+
name="device1", mac_address="00:00:00:00:00:01", organization=org
10441044
)
10451045
device2 = self._create_device(
1046-
name='device2', mac_address='00:00:00:00:00:02', organization=org
1046+
name="device2", mac_address="00:00:00:00:00:02", organization=org
10471047
)
10481048
self._create_object_location(
10491049
content_object=device1,
@@ -1057,6 +1057,6 @@ def test_floorplan_coordinates(self):
10571057
floorplan=floor2,
10581058
organization=org,
10591059
)
1060-
path = reverse('geo_api:device_floorplan_coordinates', args=[location.id])
1060+
path = reverse("geo_api:device_floorplan_coordinates", args=[location.id])
10611061
response = self.client.get(path)
10621062
print(response.__dict__)

openwisp_controller/geo/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def get_geo_urls(geo_views):
4242
name="detail_location",
4343
),
4444
path(
45-
'api/v1/controller/location/<str:pk>/floorplan/devices/',
45+
"api/v1/controller/location/<str:pk>/floorplan/devices/",
4646
geo_views.device_floorplan_coordinates,
47-
name='device_floorplan_coordinates',
47+
name="device_floorplan_coordinates",
4848
),
4949
]

0 commit comments

Comments
 (0)