mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 20:03:11 +00:00
Optimisation chargement de la page gestion droits
This commit is contained in:
parent
58605ae3ff
commit
8015b27baa
2 changed files with 3 additions and 2 deletions
|
@ -441,7 +441,7 @@ class ListRightForm(ModelForm):
|
||||||
"""Edition, d'un groupe , équivalent à un droit
|
"""Edition, d'un groupe , équivalent à un droit
|
||||||
Ne peremet pas d'editer le gid, car il sert de primary key"""
|
Ne peremet pas d'editer le gid, car il sert de primary key"""
|
||||||
permissions = forms.ModelMultipleChoiceField(
|
permissions = forms.ModelMultipleChoiceField(
|
||||||
Permission.objects.all(),
|
Permission.objects.all().select_related('content_type'),
|
||||||
widget=forms.CheckboxSelectMultiple,
|
widget=forms.CheckboxSelectMultiple,
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
|
@ -710,7 +710,8 @@ def index_school(request):
|
||||||
@can_view_all(ListRight)
|
@can_view_all(ListRight)
|
||||||
def index_listright(request):
|
def index_listright(request):
|
||||||
""" Affiche l'ensemble des droits , need droit cableur """
|
""" 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(
|
return render(
|
||||||
request,
|
request,
|
||||||
'users/index_listright.html',
|
'users/index_listright.html',
|
||||||
|
|
Loading…
Reference in a new issue