From 3365d7b9a1cc1163ce6b351a1c2e4d358b1a48c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 11 Feb 2017 17:21:59 +0100 Subject: [PATCH] Updates the decorators --- cof/decorators.py | 8 ++++---- cof/templates/home.html | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cof/decorators.py b/cof/decorators.py index d7e70608..a7ced8f7 100644 --- a/cof/decorators.py +++ b/cof/decorators.py @@ -9,8 +9,8 @@ from django_cas_ng.decorators import user_passes_test def is_cof(user): try: - profile = user.profile - return profile.is_cof + cofprofile = user.profile.cof + return cofprofile.is_cof except: return False @@ -21,8 +21,8 @@ cof_required_customdenied = user_passes_test(lambda u: is_cof(u), def is_buro(user): try: - profile = user.profile - return profile.is_buro + cofprofile = user.profile.cof + return cofprofile.is_buro except: return False diff --git a/cof/templates/home.html b/cof/templates/home.html index 5e9732c7..3fc92bfe 100644 --- a/cof/templates/home.html +++ b/cof/templates/home.html @@ -7,7 +7,7 @@
-
+
- {% if not user.profile.is_buro %} + {% if not user.profile.cof.is_buro %}