fix Level.nearest_point if there is no nearest point
This commit is contained in:
parent
497798925b
commit
c954f3976b
2 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue