diff --git a/core/models.py b/core/models.py index 63442c1f..02aa9e09 100644 --- a/core/models.py +++ b/core/models.py @@ -137,17 +137,22 @@ class User(AbstractBaseUser): return False else: return False - if group_name[-6:] == settings.SITH_BOARD_SUFFIX: - if 'club' in settings.INSTALLED_APPS: - from club.models import Club - name = group_name[:-6] - c = Club.objects.filter(unix_name=name).first() - mem = c.get_membership_for(self) - if mem: - return mem.role >= 2 - return False - else: - return False + if group_name[-len(settings.SITH_BOARD_SUFFIX):] == settings.SITH_BOARD_SUFFIX: + from club.models import Club + name = group_name[:-len(settings.SITH_BOARD_SUFFIX)] + c = Club.objects.filter(unix_name=name).first() + mem = c.get_membership_for(self) + if mem: + return mem.role > settings.SITH_MAXIMUM_FREE_ROLE + return False + if group_name[-len(settings.SITH_MEMBER_SUFFIX):] == settings.SITH_MEMBER_SUFFIX: + from club.models import Club + name = group_name[:-len(settings.SITH_MEMBER_SUFFIX)] + c = Club.objects.filter(unix_name=name).first() + mem = c.get_membership_for(self) + if mem: + return True + return False if group_name == settings.SITH_GROUPS['root']['name'] and self.is_superuser: return True return self.groups.filter(name=group_name).exists() diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index f5830be6..eaf51cf4 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -13,6 +13,7 @@ {% block header %} + {% if not popup %}
@@ -25,8 +26,12 @@ {% trans %}Logout{% endtrans %} {% endif %}
+ {% else %} +
{{ user.get_display_name() }}
+ {% endif %} {% endblock %} {% block nav %} + {% if not popup %} + {% endif %} {% endblock %}
@@ -59,8 +65,7 @@