show locations immediately after searching
This commit is contained in:
parent
9a9ea45242
commit
95fce11d00
3 changed files with 31 additions and 6 deletions
|
@ -359,9 +359,13 @@ class LocationViewSetBase(RetrieveModelMixin, GenericViewSet):
|
|||
if isinstance(location, LocationRedirect):
|
||||
return redirect('../' + str(location.target.pk) + '/geometry/')
|
||||
|
||||
return Response(location.get_geometry(
|
||||
detailed_geometry=MapdataViewSet.can_access_geometry(request, location),
|
||||
))
|
||||
return Response({
|
||||
'id': location.id,
|
||||
'level': getattr(location, 'level_id', None),
|
||||
'geometry': location.get_geometry(
|
||||
detailed_geometry=MapdataViewSet.can_access_geometry(request, location)
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
class LocationViewSet(LocationViewSetBase):
|
||||
|
|
|
@ -348,6 +348,9 @@ class CustomLocation:
|
|||
result['display'].pop(6)
|
||||
return result
|
||||
|
||||
def get_geometry(self, detailed_geometry=True):
|
||||
return None
|
||||
|
||||
@cached_property
|
||||
def description(self):
|
||||
from c3nav.routing.router import Router
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue