Commit | Line | Data |
---|---|---|
5579d48d | 1 | from django import template |
286d0aa9 | 2 | from project.dae.workflow import ETATS_EDITABLE |
d8cfc3d5 | 3 | from project.dae.workflow import grp_correspondants_rh, grp_administrateurs, grp_drh |
5579d48d OL |
4 | |
5 | register = template.Library() | |
6 | ||
7 | @register.filter | |
8 | def peut_ajouter(user): | |
9 | for g in user.groups.all(): | |
d8cfc3d5 | 10 | if g in (grp_administrateurs, grp_correspondants_rh, grp_drh): |
5579d48d OL |
11 | return True |
12 | return False | |
13 | ||
286d0aa9 OL |
14 | @register.filter |
15 | def est_editable(obj): | |
16 | if obj.etat in ETATS_EDITABLE: | |
17 | return True | |
18 | else: | |
19 | return False | |
20 |