From 9185c999afdde2021032f6c96358eb3e66195d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 17 Dec 2017 03:24:12 +0100 Subject: [PATCH] =?UTF-8?q?with=5Ftype=20=E2=86=92=20include=5Ftype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c3nav/mapdata/models/locations.py | 6 +++--- src/c3nav/routing/route.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c3nav/mapdata/models/locations.py b/src/c3nav/mapdata/models/locations.py index d33c99e2..b548cc01 100644 --- a/src/c3nav/mapdata/models/locations.py +++ b/src/c3nav/mapdata/models/locations.py @@ -319,13 +319,13 @@ class LocationRedirect(LocationSlug): target = models.ForeignKey(LocationSlug, related_name='redirects', on_delete=models.CASCADE, verbose_name=_('target')) - def _serialize(self, with_type=True, **kwargs): - result = super()._serialize(with_type=with_type, **kwargs) + def _serialize(self, include_type=True, **kwargs): + result = super()._serialize(include_type=include_type, **kwargs) if type(self.target) == LocationSlug: result['target'] = self.target.get_child().slug else: result['target'] = self.target.slug - if with_type: + if include_type: result['type'] = 'redirect' result.pop('id') return result diff --git a/src/c3nav/routing/route.py b/src/c3nav/routing/route.py index 402278de..4b66e818 100644 --- a/src/c3nav/routing/route.py +++ b/src/c3nav/routing/route.py @@ -14,7 +14,7 @@ def describe_location(location, locations): location = final_location else: location.can_describe = False - return location.serialize(detailed=False, describe_only=True, simple_geometry=True) + return location.serialize(include_type=True, detailed=False, describe_only=True, simple_geometry=True) class Route: