Commit 8015b27b authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root
Browse files

Optimisation chargement de la page gestion droits

parent 58605ae3
......@@ -441,7 +441,7 @@ class ListRightForm(ModelForm):
"""Edition, d'un groupe , équivalent à un droit
Ne peremet pas d'editer le gid, car il sert de primary key"""
permissions = forms.ModelMultipleChoiceField(
Permission.objects.all(),
Permission.objects.all().select_related('content_type'),
widget=forms.CheckboxSelectMultiple,
required=False
)
......
......@@ -710,7 +710,8 @@ def index_school(request):
@can_view_all(ListRight)
def index_listright(request):
""" Affiche l'ensemble des droits , need droit cableur """
listright_list = ListRight.objects.order_by('unix_name')
listright_list = ListRight.objects.order_by('unix_name')\
.prefetch_related('permissions').prefetch_related('user_set')
return render(
request,
'users/index_listright.html',
......
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