Merge branch 'feature/nearest_establishments_fix' into 'develop'
Fixed nearest establishments search See merge request gm/gm-backend!106
This commit is contained in:
commit
a485fc1c7f
|
|
@ -162,7 +162,7 @@ class EstablishmentNearestRetrieveView(EstablishmentListView, generics.ListAPIVi
|
|||
|
||||
qs = super(EstablishmentNearestRetrieveView, self).get_queryset()
|
||||
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}
|
||||
return qs.by_distance_from_point(**{k: v for k, v in filter_kwargs.items()
|
||||
if v is not None})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user