Add logging call

This commit is contained in:
Ludovic Stephan 2019-06-17 21:20:57 +02:00
parent 20bb9fe54b
commit edd92beadf

View file

@ -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