change location color priority

This commit is contained in:
Laura Klünder 2017-05-13 20:21:45 +02:00
parent c4412ba4e4
commit 84ebce2e0d

View file

@ -113,7 +113,7 @@ class Location(LocationSlug, EditorFormMixin, models.Model):
def get_color(self):
if self.color:
return self.color
color_group = self.groups.filter(color__isnull=False).order_by('-compiled_area', '-compiled_room').first()
color_group = self.groups.filter(color__isnull=False).order_by('compiled_area', 'compiled_room').first()
if color_group:
return color_group.color
return None