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 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.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import render
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def cof_required(view_func):
|
||||
"""Décorateur qui vérifie que l'utilisateur est connecté et membre du COF.
|
||||
|
@ -69,4 +71,7 @@ class BuroRequiredMixin(PermissionRequiredMixin):
|
|||
try:
|
||||
return self.request.user.profile.is_buro
|
||||
except AttributeError:
|
||||
logger.error(
|
||||
"L'utilisateur %s n'a pas de profil !", self.request.user.username
|
||||
)
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue