0.5.4 auth
[auf_rh_dae.git] / project / dae / templatetags / dae.py
... / ...
CommitLineData
1from django import template
2from project.dae.workflow import ETATS_EDITABLE
3from project.dae.workflow import grp_correspondants_rh, grp_administrateurs, grp_drh
4
5register = template.Library()
6
7@register.filter
8def peut_ajouter(user):
9 for g in user.groups.all():
10 if g in (grp_administrateurs, grp_correspondants_rh, grp_drh):
11 return True
12 return False
13
14@register.filter
15def est_editable(obj):
16 if obj.etat in ETATS_EDITABLE:
17 return True
18 else:
19 return False
20