From 2fa482d9fd1d0550e73ab96ae0fffadd466df7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 11 Jul 2017 19:02:33 +0200 Subject: [PATCH] get_color() only allow groups that are allowed for this model --- src/c3nav/mapdata/models/locations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c3nav/mapdata/models/locations.py b/src/c3nav/mapdata/models/locations.py index 4a5bc8f3..51dff886 100644 --- a/src/c3nav/mapdata/models/locations.py +++ b/src/c3nav/mapdata/models/locations.py @@ -124,7 +124,7 @@ class Location(LocationSlug, TitledMixin, models.Model): if instance is None: instance = self for group in instance.groups.all(): - if group.color: + if group.color and getattr(group.category, 'allow_'+self.__class__._meta.default_related_name): return group.color return None