Commit 5a6acb59 authored by moamoak's avatar moamoak

Merge branch 'service_user_del' into 'master'

Fix del/edit serviceuser

See merge request federez/re2o!119
parents e80c50ff 529fbe6c
......@@ -275,12 +275,12 @@ def new_serviceuser(request):
def edit_serviceuser(request, serviceuser, serviceuserid):
""" Edit a ServiceUser """
user = EditServiceUserForm(request.POST or None, instance=user)
if user.is_valid():
user_object =
if user.cleaned_data['password']:
if user.changed_data:
serviceuser = EditServiceUserForm(request.POST or None, instance=serviceuser)
if serviceuser.is_valid():
user_object =
if serviceuser.cleaned_data['password']:
if serviceuser.changed_data:
messages.success(request, "L'user a bien été modifié")
return redirect(reverse('users:index-serviceusers'))
......@@ -292,7 +292,7 @@ def edit_serviceuser(request, serviceuser, serviceuserid):
def del_serviceuser(request, serviceuser, serviceuserid):
"""Suppression d'un ou plusieurs serviceusers"""
if request.method == "POST":
messages.success(request, "L'user a été détruite")
return redirect(reverse('users:index-serviceusers'))
return form(
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