forked from DGNum/gestioCOF
Add logging call
This commit is contained in:
parent
20bb9fe54b
commit
edd92beadf
1 changed files with 7 additions and 2 deletions
|
@ -1,10 +1,12 @@
|
||||||
|
import logging
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
from django.contrib.auth.decorators import login_required, user_passes_test
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth.mixins import PermissionRequiredMixin
|
from django.contrib.auth.mixins import PermissionRequiredMixin
|
||||||
from django.core.exceptions import PermissionDenied
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def cof_required(view_func):
|
def cof_required(view_func):
|
||||||
"""Décorateur qui vérifie que l'utilisateur est connecté et membre du COF.
|
"""Décorateur qui vérifie que l'utilisateur est connecté et membre du COF.
|
||||||
|
@ -69,4 +71,7 @@ class BuroRequiredMixin(PermissionRequiredMixin):
|
||||||
try:
|
try:
|
||||||
return self.request.user.profile.is_buro
|
return self.request.user.profile.is_buro
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
logger.error(
|
||||||
|
"L'utilisateur %s n'a pas de profil !", self.request.user.username
|
||||||
|
)
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue