diff --git a/cotisations/views.py b/cotisations/views.py index fa72a46e..6b07aecc 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -66,7 +66,7 @@ def new_facture(request, userid): messages.success(request, "La cotisation a été prolongée pour l'adhérent %s " % user.name ) else: messages.success(request, "La facture a été crée") - return redirect("/cotisations/") + return redirect("/cotisations/profil/" + userid) return form({'factureform': facture_form}, 'cotisations/facture.html', request) def edit_facture(request, factureid): diff --git a/machines/views.py b/machines/views.py index 437599ae..d47cb518 100644 --- a/machines/views.py +++ b/machines/views.py @@ -66,7 +66,7 @@ def new_machine(request, userid): messages.error(request, u"Il n'y a plus d'ip disponibles") new_interface.save() messages.success(request, "La machine a été crée") - return redirect("/users/") + return redirect("/users/profil/" + userid) return form({'machineform': machine, 'interfaceform': interface}, 'machines/machine.html', request) def edit_machine(request, interfaceid): diff --git a/topologie/views.py b/topologie/views.py index aff1fb62..34a3d40e 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -34,7 +34,7 @@ def new_port(request, switch_id): port.save() messages.success(request, "Port ajouté") except IntegrityError: - pass + messages.error(request,"Ce port existe déjà" ) return redirect("/topologie/switch/" + switch_id) return form({'topoform':port}, 'topologie/port.html', request) diff --git a/users/views.py b/users/views.py index c3e60a9b..243ad621 100644 --- a/users/views.py +++ b/users/views.py @@ -93,7 +93,7 @@ def edit_info(request, userid): if user.is_valid(): user.save() messages.success(request, "L'user a bien été modifié") - return redirect("/users/") + return redirect("/users/profil/" + userid) return form({'userform': user}, 'users/user.html', request) def state(request, userid): @@ -111,7 +111,7 @@ def state(request, userid): unarchive(user) state.save() messages.success(request, "Etat changé avec succès") - return redirect("/users/") + return redirect("/users/profil/" + userid) return form({'userform': state}, 'users/user.html', request) def password(request, userid): @@ -129,7 +129,7 @@ def password(request, userid): user.pwd_ntlm = hashNT(user_form.cleaned_data['passwd1']) user.save() messages.success(request, "Le mot de passe a changé") - return redirect("/users/") + return redirect("/users/profil/" + userid) return form({'userform': user_form}, 'users/user.html', request) def add_right(request, userid): @@ -147,7 +147,7 @@ def add_right(request, userid): messages.success(request, "Droit ajouté") except IntegrityError: pass - return redirect("/users/") + return redirect("/users/profil/" + userid) return form({'userform': right}, 'users/user.html', request) def del_right(request): @@ -170,7 +170,7 @@ def add_ban(request, userid): if ban.is_valid(): ban.save() messages.success(request, "Bannissement ajouté") - return redirect("/users/") + return redirect("/users/profil/" + userid) if is_ban(user): messages.error(request, u"Attention, cet utilisateur a deja un bannissement actif" ) return form({'userform': ban}, 'users/user.html', request) @@ -199,7 +199,7 @@ def add_whitelist(request, userid): if whitelist.is_valid(): whitelist.save() messages.success(request, "Accès à titre gracieux accordé") - return redirect("/users/") + return redirect("/users/profil/" + userid) if is_whitelisted(user): messages.error(request, u"Attention, cet utilisateur a deja un accès gracieux actif" ) return form({'userform': whitelist}, 'users/user.html', request)