Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 9d79ffb5 authored by Levy--Falk Hugo's avatar Levy--Falk Hugo

Plus de BÔTÉ dans l'affichage des superusers

parent 8a199777
......@@ -66,7 +66,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td><p class="text-success">{{utilisateur.last}}</p></td>
{% endif %}
{% if droit != 'Superuser' %}
<a href="{% url 'users:del-group' utilisateur.id droit.id %}">
{% else %}
<a href="{% url 'users:del-superuser' utilisateur.id %}">
{% endif %}
<button type="button" class="btn btn-danger" aria-label="Left Align">
<span class="fa fa-user-times" aria-hidden="true"></span>
......@@ -79,4 +83,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endfor %}
\ No newline at end of file
{% endfor %}
......@@ -41,7 +41,7 @@ from django.urls import reverse
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db.models import Count, Max
from django.db.models import Count, Max, F
from reversion.models import Revision
from reversion.models import Version, ContentType
......@@ -469,9 +469,14 @@ def stats_droits(request):
for droit in ListRight.objects.all().select_related('group_ptr'):
stats_list[droit] = droit.user_set.all().annotate(
stats_list['Superuser'] = User.objects.filter(is_superuser=True).annotate(
return render(
......@@ -457,7 +457,7 @@ class GroupForm(FormRevMixin, ModelForm):
class Meta:
model = User
fields = ['groups', 'is_superuser']
fields = ['is_superuser', 'groups']
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
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