8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Optimisation chargement de la page gestion droits

This commit is contained in:
Gabriel Detraz 2018-01-31 02:46:48 +01:00 committed by root
parent 58605ae3ff
commit 8015b27baa
2 changed files with 3 additions and 2 deletions

View file

@ -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
)

View file

@ -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',