From 3a0fcefae1a62e1b18e103413066ae5840b0327b Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Thu, 26 Oct 2017 11:14:16 +0200 Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20=C3=A0=20la=20page=20/topolo?= =?UTF-8?q?gie/switch/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/templates/topologie/index_p.html | 1 + topologie/views.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/topologie/templates/topologie/index_p.html b/topologie/templates/topologie/index_p.html index 84159659..3f9356f2 100644 --- a/topologie/templates/topologie/index_p.html +++ b/topologie/templates/topologie/index_p.html @@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if is_infra %} Editer Ajouter un port + Ajouter des ports {% endif %} {% include "topologie/aff_port.html" with port_list=port_list %}
diff --git a/topologie/views.py b/topologie/views.py index 11b889fa..4561506a 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -440,10 +440,10 @@ def create_ports(request, switch_id): e = [] if end < begin: messages.error(request, "Port de fin inférieur au port de début !") - return redirect("/topologie/") + return redirect("/topologie/switch/" + str(switch.id)) if end - begin > switch.number: messages.error(request, "Ce switch ne peut avoir autant de ports.") - return redirect("/topologie/") + return redirect("/topologie/switch/" + str(switch.id)) if begin < s_begin: b = range(begin, s_begin) @@ -461,7 +461,7 @@ def create_ports(request, switch_id): messages.success(request, "Création du port %d" % i) except IntegrityError: messages.error(request, "Création d'un port existant.") - return redirect("/topologie/") + return redirect("/topologie/switch/" + str(switch.id)) return form({'topoform': port_form,}, 'topologie/switch.html', request)