Commit cf7ba4d6 authored by Bonnegent Sebastien's avatar Bonnegent Sebastien
Browse files

Merge branch '48-permettre-la-vue-de-toutes-les-pao-a-tous-les-enseignants' into 'master'

Resolve "permettre la vue de toutes les PAO à tous les enseignants"

Closes #48

See merge request !28
parents 2fe557aa 4b5bb8d9
......@@ -13,4 +13,5 @@ db.sqlite3*
from import BaseCommand
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from import ldaprequest
......@@ -15,6 +16,8 @@ class Command(BaseCommand):
f">> création du groupe enseignant [{settings.GROUP_TEACHER}]"
grp_add_perm = Permission.objects.get(name="Can add pao")
for element in settings.LDAP_GROUPS_TEACHERS:
enseignants = ldaprequest.get_usernames(element)
......@@ -215,7 +215,7 @@ class CampagneDetail(MenuPAO, generic.DetailView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
user = self.request.user
if user.is_superuser is True:
if user.is_superuser is True or est_un_enseignant(user):
context["pao_list"] = self.object.pao_set.all()
context["pao_list"] = self.object.get_pao_visibles(user)
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