describe locations only with groups that have can_describe set

This commit is contained in:
Laura Klünder 2017-12-19 18:40:28 +01:00
parent 444e45b110
commit ec53cb5531

View file

@ -166,6 +166,7 @@ class SpecificLocation(Location, models.Model):
@property
def subtitle(self):
groups = tuple(self.groups.all() if 'groups' in getattr(self, '_prefetched_objects_cache', ()) else ())
groups = tuple(group.can_describe for group in groups)
return groups[0].title if groups else self.__class__._meta.verbose_name
@cached_property