From ac223086fe10f38602ea300fbb8810d556168fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 27 Dec 2016 19:42:46 +0100 Subject: [PATCH] fix /api/locations etag --- src/c3nav/mapdata/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c3nav/mapdata/api.py b/src/c3nav/mapdata/api.py index 3448d622..883a9103 100644 --- a/src/c3nav/mapdata/api.py +++ b/src/c3nav/mapdata/api.py @@ -179,7 +179,7 @@ class LocationViewSet(ViewSet): 'full_access': request.c3nav_full_access, 'access_list': request.c3nav_access_list, 'last_update': get_last_mapdata_update().isoformat() - })) + }).encode()).hexdigest() if_none_match = request.META.get('HTTP_IF_NONE_MATCH') if if_none_match: @@ -194,6 +194,7 @@ class LocationViewSet(ViewSet): response = Response([location.to_location_json() for location in locations]) response['ETag'] = etag response['Cache-Control'] = 'no-cache' + return response def retrieve(self, request, name=None, **kwargs): location = get_location(request, name)