Fixed nearest establishments search
This commit is contained in:
parent
a372d29677
commit
d717b09153
|
|
@ -162,7 +162,7 @@ class EstablishmentNearestRetrieveView(EstablishmentListView, generics.ListAPIVi
|
||||||
|
|
||||||
qs = super(EstablishmentNearestRetrieveView, self).get_queryset()
|
qs = super(EstablishmentNearestRetrieveView, self).get_queryset()
|
||||||
if lat and lon and radius and unit:
|
if lat and lon and radius and unit:
|
||||||
center = Point(float(lat), float(lon))
|
center = Point(float(lon), float(lat))
|
||||||
filter_kwargs = {'center': center, 'radius': float(radius), 'unit': unit}
|
filter_kwargs = {'center': center, 'radius': float(radius), 'unit': unit}
|
||||||
return qs.by_distance_from_point(**{k: v for k, v in filter_kwargs.items()
|
return qs.by_distance_from_point(**{k: v for k, v in filter_kwargs.items()
|
||||||
if v is not None})
|
if v is not None})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user