diff --git a/users/templates/users/aff_listright.html b/users/templates/users/aff_listright.html
index 7807c1d3..8906b38e 100644
--- a/users/templates/users/aff_listright.html
+++ b/users/templates/users/aff_listright.html
@@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for user in superuser_right %}
{{user}}
-
+
diff --git a/users/urls.py b/users/urls.py
index 05f72be0..5d868196 100644
--- a/users/urls.py
+++ b/users/urls.py
@@ -43,6 +43,9 @@ urlpatterns = [
url(r'^del_group/(?P[0-9]+)/(?P[0-9]+)$',
views.del_group,
name='del-group'),
+ url(r'^del_superuser/(?P[0-9]+)$',
+ views.del_superuser,
+ name='del-superuser'),
url(r'^new_serviceuser/$', views.new_serviceuser, name='new-serviceuser'),
url(r'^edit_serviceuser/(?P[0-9]+)$',
views.edit_serviceuser,
diff --git a/users/views.py b/users/views.py
index 797b3eb2..2ed4f3fb 100644
--- a/users/views.py
+++ b/users/views.py
@@ -294,6 +294,16 @@ def del_group(request, user, listrightid, **_kwargs):
return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
+@login_required
+@can_edit(User, 'groups')
+def del_superuser(request, user, **_kwargs):
+ """Remove the superuser right of an user."""
+ user.is_superuser = False
+ user.save()
+ messages.success(request, "%s n'est plus superuser" % user)
+ return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
+
+
@login_required
@can_create(ServiceUser)
def new_serviceuser(request):