diff --git a/dronken/models.py b/dronken/models.py index 76a7384..4aa6c41 100644 --- a/dronken/models.py +++ b/dronken/models.py @@ -31,6 +31,10 @@ class Association(models.Model): return self.name def get_state_display(self): + + if not self.has_intern: + return "Geen intern!" + values = dict(list(Association.STATES)) values.update(dict([(x.value, x.name) for x in self.extra_states.all()])) diff --git a/dronken/views.py b/dronken/views.py index 9d75f4c..88c0e51 100644 --- a/dronken/views.py +++ b/dronken/views.py @@ -88,8 +88,14 @@ class AssociationBadgeView(View): } def generate_badge(self, association): + + color = AssociationBadgeView.STATE_TO_COLOR.get(association.state, 'yellow') + + if not association.has_intern: + color = 'lightgrey' + badge = anybadge.Badge(lxml.html.fromstring(association.short_name).text_content(), association.get_state_display(), - default_color=AssociationBadgeView.STATE_TO_COLOR.get(association.state, 'yellow')) + default_color=color) return badge.badge_svg_text