Commit f829b42d authored by Valentin Samir's avatar Valentin Samir

Ajout des groupes crans_imprimeur_club et crans_respo_club à django

parent ffddf934
......@@ -93,6 +93,14 @@ class CransCASBackend(CASBackend):
group, created = Group.objects.get_or_create(name="crans_paiement_ok")
group.save()
groups.append(group)
if cl_user.imprimeur_clubs():
group, created = Group.objects.get_or_create(name="crans_imprimeur_club")
group.save()
groups.append(group)
if cl_user.clubs():
group, created = Group.objects.get_or_create(name="crans_respo_club")
group.save()
groups.append(group)
user.groups = [ group for group in user.groups.all() if not group.name.startswith('crans_') ]
user.groups.add(*groups)
......
......@@ -54,6 +54,15 @@ def refresh_droits(user, cl_user):
group, created = Group.objects.get_or_create(name="crans_paiement_ok")
group.save()
groups.append(group)
if cl_user.imprimeur_clubs():
group, created = Group.objects.get_or_create(name="crans_imprimeur_club")
group.save()
groups.append(group)
if cl_user.clubs():
group, created = Group.objects.get_or_create(name="crans_respo_club")
group.save()
groups.append(group)
user.groups = [ group for group in user.groups.all() if not group.name.startswith('crans_') ]
user.groups.add(*groups)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment