Updates the decorators
This commit is contained in:
parent
6c3e1bd2db
commit
3365d7b9a1
2 changed files with 10 additions and 10 deletions
|
@ -9,8 +9,8 @@ from django_cas_ng.decorators import user_passes_test
|
||||||
|
|
||||||
def is_cof(user):
|
def is_cof(user):
|
||||||
try:
|
try:
|
||||||
profile = user.profile
|
cofprofile = user.profile.cof
|
||||||
return profile.is_cof
|
return cofprofile.is_cof
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ cof_required_customdenied = user_passes_test(lambda u: is_cof(u),
|
||||||
|
|
||||||
def is_buro(user):
|
def is_buro(user):
|
||||||
try:
|
try:
|
||||||
profile = user.profile
|
cofprofile = user.profile.cof
|
||||||
return profile.is_buro
|
return cofprofile.is_buro
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="container hidden-xs espace"></div>
|
<div class="container hidden-xs espace"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="home-menu row">
|
<div class="home-menu row">
|
||||||
<div class="{% if user.profile.is_buro %}col-sm-6 {% else %}col-sm-8 col-sm-offset-2 col-xs-12 {%endif%}normal-user-hm">
|
<div class="{% if user.profile.cof.is_buro %}col-sm-6 {% else %}col-sm-8 col-sm-offset-2 col-xs-12 {%endif%}normal-user-hm">
|
||||||
<!-- {% if open_events %}
|
<!-- {% if open_events %}
|
||||||
<h3 class="block-title">Événements<span class="pull-right glyphicon glyphicon-calendar"></span></h3>
|
<h3 class="block-title">Événements<span class="pull-right glyphicon glyphicon-calendar"></span></h3>
|
||||||
<div class="hm-block">
|
<div class="hm-block">
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if user.profile.is_cof %}
|
{% if user.profile.cof.is_cof %}
|
||||||
{% if open_tirages %}
|
{% if open_tirages %}
|
||||||
<h3 class="block-title">Tirages du BdA<span class="pull-right glyphicon glyphicon-th-list"></span></h3>
|
<h3 class="block-title">Tirages du BdA<span class="pull-right glyphicon glyphicon-th-list"></span></h3>
|
||||||
<div class="hm-block">
|
<div class="hm-block">
|
||||||
|
@ -55,15 +55,15 @@
|
||||||
<div class="hm-block">
|
<div class="hm-block">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{% url "cof.views.calendar" %}">Calendrier dynamique</a></li>
|
<li><a href="{% url "cof.views.calendar" %}">Calendrier dynamique</a></li>
|
||||||
{% if user.profile.is_cof %}<li><a href="{% url "petits-cours-inscription" %}">Inscription pour donner des petits cours</a></li>{% endif %}
|
{% if user.profile.cof.is_cof %}<li><a href="{% url "petits-cours-inscription" %}">Inscription pour donner des petits cours</a></li>{% endif %}
|
||||||
|
|
||||||
<li><a href="{% url "cof.views.profile" %}">Éditer mon profil</a></li>
|
<li><a href="{% url "profile" %}">Éditer mon profil</a></li>
|
||||||
{% if not user.profile.login_clipper %}<li><a href="{% url "django.contrib.auth.views.password_change" %}">Changer mon mot de passe</a></li>{% endif %}
|
{% if not user.profile.login_clipper %}<li><a href="{% url "django.contrib.auth.views.password_change" %}">Changer mon mot de passe</a></li>{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if user.profile.is_buro %}
|
{% if user.profile.cof.is_buro %}
|
||||||
<div class="col-sm-6 buro-user-hm">
|
<div class="col-sm-6 buro-user-hm">
|
||||||
<h3 class="block-title">Administration<span class="pull-right glyphicon glyphicon-cog"></span></h3>
|
<h3 class="block-title">Administration<span class="pull-right glyphicon glyphicon-cog"></span></h3>
|
||||||
<div class="hm-block">
|
<div class="hm-block">
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div> <!-- /.row.home-menu -->
|
</div> <!-- /.row.home-menu -->
|
||||||
<div class="container hidden-xs espace"></div>
|
<div class="container hidden-xs espace"></div>
|
||||||
{% if not user.profile.is_buro %}
|
{% if not user.profile.cof.is_buro %}
|
||||||
<div class="home-menu row row-centered">
|
<div class="home-menu row row-centered">
|
||||||
<div class="col-sm-8 col-sm-offset-2 col-xs-12 normal-user-hm">
|
<div class="col-sm-8 col-sm-offset-2 col-xs-12 normal-user-hm">
|
||||||
<div class="foot-banner">
|
<div class="foot-banner">
|
||||||
|
|
Loading…
Reference in a new issue