Supprimé le répertoire django_qbe.egg-info
[auf_rh_dae.git] / project / context_processors.py
CommitLineData
e993f3dc 1# -*- encoding: utf-8 -*-
0f844142 2
75f0e87b
DB
3from project.lib import get_employe_from_user
4from project.permissions import is_admin
e993f3dc 5
6# Ajout de variables accessibles dans les templates (pour tester permissions dans templates)
7
8def utilisateur(request):
9 return {'utilisateur': request.user}
10
0f844142 11def this_employe(request):
12 user = request.user
13 employe = get_employe_from_user(user)
14 return {'this_employe': employe}
15
e993f3dc 16def user_is_admin(request):
17 return {'user_is_admin': not request.user.is_anonymous() and is_admin(request.user)}
18