refact ergo + page perso (vide)
[auf_rh_dae.git] / project / context_processors.py
... / ...
CommitLineData
1# -*- encoding: utf-8 -*-
2
3from lib import get_employe_from_user
4from permissions import is_admin
5
6# Ajout de variables accessibles dans les templates (pour tester permissions dans templates)
7
8def utilisateur(request):
9 return {'utilisateur': request.user}
10
11def this_employe(request):
12 user = request.user
13 employe = get_employe_from_user(user)
14 return {'this_employe': employe}
15
16def user_is_admin(request):
17 return {'user_is_admin': not request.user.is_anonymous() and is_admin(request.user)}
18