From 1c70dbefc2bfcc1296cc37ecb48e12fbe622b303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 19 Dec 2016 18:13:14 +0100 Subject: [PATCH] reverse sorting in location list and when determining point location --- src/c3nav/mapdata/api.py | 2 +- src/c3nav/routing/route.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c3nav/mapdata/api.py b/src/c3nav/mapdata/api.py index 162ffd1e..cba231c1 100644 --- a/src/c3nav/mapdata/api.py +++ b/src/c3nav/mapdata/api.py @@ -169,7 +169,7 @@ class LocationViewSet(CachedReadOnlyViewSetMixin, ViewSet): def list(self, request, **kwargs): locations = [] locations += sorted(filter_queryset_by_package_access(request, AreaLocation.objects.filter(can_search=True)), - key=AreaLocation.get_sort_key) + key=AreaLocation.get_sort_key, reverse=True) locations += list(filter_queryset_by_package_access(request, LocationGroup.objects.filter(can_search=True))) return Response([location.to_location_json() for location in locations]) diff --git a/src/c3nav/routing/route.py b/src/c3nav/routing/route.py index b54491ff..c5b69ed0 100644 --- a/src/c3nav/routing/route.py +++ b/src/c3nav/routing/route.py @@ -56,7 +56,7 @@ class Route: print(point.arealocations) locations = sorted(AreaLocation.objects.filter(location_type__in=('room', 'level', 'area'), name__in=point.arealocations), - key=AreaLocation.get_sort_key) + key=AreaLocation.get_sort_key, reverse=True) if not locations: return _('Unknown Location'), _('Unknown Location')