diff --git a/src/c3nav/mapdata/models/locations.py b/src/c3nav/mapdata/models/locations.py index 89e7fa86..537f58b9 100644 --- a/src/c3nav/mapdata/models/locations.py +++ b/src/c3nav/mapdata/models/locations.py @@ -210,16 +210,15 @@ class AreaLocation(LocationModelMixin, GeometryMapItemWithLevel): @property def subtitle(self): - return self.get_subtitle(with_type=False) + return self.get_subtitle() @property def subtitle_without_type(self): - return self.get_subtitle(with_type=False) + return self.get_subtitle() - def get_subtitle(self, with_type=True): + def get_subtitle(self): items = [] - if with_type: - items += [self.get_location_type_display()] + items += [group.title for group in self.groups.all()] items += [area.title for area in self.get_in_areas() if area.can_describe] return ', '.join(items) diff --git a/src/c3nav/routing/level.py b/src/c3nav/routing/level.py index c9bacd3b..09760410 100644 --- a/src/c3nav/routing/level.py +++ b/src/c3nav/routing/level.py @@ -391,6 +391,8 @@ class GraphLevel(): if nearest_point is None: nearest_point = self._nearest_point(point, mode) cache.set(cache_key, nearest_point, 60) + if nearest_point is None: + return None return self.graph.points[nearest_point] def _nearest_point(self, point, mode):