describe locations only with groups that have can_describe set
This commit is contained in:
parent
444e45b110
commit
ec53cb5531
1 changed files with 1 additions and 0 deletions
|
@ -166,6 +166,7 @@ class SpecificLocation(Location, models.Model):
|
||||||
@property
|
@property
|
||||||
def subtitle(self):
|
def subtitle(self):
|
||||||
groups = tuple(self.groups.all() if 'groups' in getattr(self, '_prefetched_objects_cache', ()) else ())
|
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
|
return groups[0].title if groups else self.__class__._meta.verbose_name
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue