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