mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 11:53:12 +00:00
Merge branch 'master' into 'profil_frontend'
# Conflicts: # users/views.py
This commit is contained in:
commit
2fffa98d46
3 changed files with 7 additions and 7 deletions
|
@ -181,7 +181,7 @@ def index_ap(request):
|
||||||
def index_stack(request):
|
def index_stack(request):
|
||||||
"""Affichage de la liste des stacks (affiche l'ensemble des switches)"""
|
"""Affichage de la liste des stacks (affiche l'ensemble des switches)"""
|
||||||
stack_list = Stack.objects\
|
stack_list = Stack.objects\
|
||||||
.prefetch_related('switch_set__domain__extension')
|
.prefetch_related('switch_set__interface_set__domain__extension')
|
||||||
stack_list = SortTable.sort(
|
stack_list = SortTable.sort(
|
||||||
stack_list,
|
stack_list,
|
||||||
request.GET.get('col'),
|
request.GET.get('col'),
|
||||||
|
|
|
@ -45,12 +45,12 @@ urlpatterns = [
|
||||||
url(r'^del_group/(?P<userid>[0-9]+)/(?P<listrightid>[0-9]+)$', views.del_group, name='del-group'),
|
url(r'^del_group/(?P<userid>[0-9]+)/(?P<listrightid>[0-9]+)$', views.del_group, name='del-group'),
|
||||||
url(r'^new_serviceuser/$', views.new_serviceuser, name='new-serviceuser'),
|
url(r'^new_serviceuser/$', views.new_serviceuser, name='new-serviceuser'),
|
||||||
url(
|
url(
|
||||||
r'^edit_serviceuser/(?P<userid>[0-9]+)$',
|
r'^edit_serviceuser/(?P<serviceuserid>[0-9]+)$',
|
||||||
views.edit_serviceuser,
|
views.edit_serviceuser,
|
||||||
name='edit-serviceuser'
|
name='edit-serviceuser'
|
||||||
),
|
),
|
||||||
url(
|
url(
|
||||||
r'^del_serviceuser/(?P<userid>[0-9]+)$',
|
r'^del_serviceuser/(?P<serviceuserid>[0-9]+)$',
|
||||||
views.del_serviceuser,
|
views.del_serviceuser,
|
||||||
name='del-serviceuser'
|
name='del-serviceuser'
|
||||||
),
|
),
|
||||||
|
|
|
@ -275,7 +275,7 @@ def new_serviceuser(request):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@can_edit(ServiceUser)
|
@can_edit(ServiceUser)
|
||||||
def edit_serviceuser(request, user, userid):
|
def edit_serviceuser(request, serviceuser, serviceuserid):
|
||||||
""" Edit a ServiceUser """
|
""" Edit a ServiceUser """
|
||||||
user = EditServiceUserForm(request.POST or None, instance=user)
|
user = EditServiceUserForm(request.POST or None, instance=user)
|
||||||
if user.is_valid():
|
if user.is_valid():
|
||||||
|
@ -286,19 +286,19 @@ def edit_serviceuser(request, user, userid):
|
||||||
user_object.save()
|
user_object.save()
|
||||||
messages.success(request, "L'user a bien été modifié")
|
messages.success(request, "L'user a bien été modifié")
|
||||||
return redirect(reverse('users:index-serviceusers'))
|
return redirect(reverse('users:index-serviceusers'))
|
||||||
return form({'userform': user, 'action_name':'Editer un serviceuser'}, 'users/user.html', request)
|
return form({'userform': serviceuser, 'action_name':'Editer un serviceuser'}, 'users/user.html', request)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@can_delete(ServiceUser)
|
@can_delete(ServiceUser)
|
||||||
def del_serviceuser(request, user, userid):
|
def del_serviceuser(request, serviceuser, serviceuserid):
|
||||||
"""Suppression d'un ou plusieurs serviceusers"""
|
"""Suppression d'un ou plusieurs serviceusers"""
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
user.delete()
|
user.delete()
|
||||||
messages.success(request, "L'user a été détruite")
|
messages.success(request, "L'user a été détruite")
|
||||||
return redirect(reverse('users:index-serviceusers'))
|
return redirect(reverse('users:index-serviceusers'))
|
||||||
return form(
|
return form(
|
||||||
{'objet': user, 'objet_name': 'serviceuser'},
|
{'objet': serviceuser, 'objet_name': 'serviceuser'},
|
||||||
'users/delete.html',
|
'users/delete.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue