From 1b2da1b830bf2d20bcfebbd42127b563908680b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Fri, 13 Oct 2017 23:36:04 +0000 Subject: [PATCH] Fix form topologie (new stack + affichage stack) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La création réussie d'une stack redirect sur la liste des stack et ne renvoie pas sur le formulaire de création La stack s'affichae même si il n'y a aucune interface liée --- topologie/templates/topologie/aff_stacks.html | 77 ++++++++++++------- topologie/views.py | 2 + 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/topologie/templates/topologie/aff_stacks.html b/topologie/templates/topologie/aff_stacks.html index 34e7b959..586fd90a 100644 --- a/topologie/templates/topologie/aff_stacks.html +++ b/topologie/templates/topologie/aff_stacks.html @@ -30,32 +30,53 @@ with this program; if not, write to the Free Software Foundation, Inc., Details Membres - - {% for stack in stack_list %} - {% for switch in stack.switch_set.all %} - - {% if forloop.first %} - {{stack.name}} - {{stack.stack_id}} - {{stack.details}} - {% endif %} - {{switch}} - {% if forloop.first %} - - - - - {% if is_infra %} - - - - - - - {% endif %} - - {% endif %} - - {% endfor %} - {% endfor %} + + {% for stack in stack_list %} + {% for switch in stack.switch_set.all %} + + + {% if forloop.first %} + {{stack.name}} + {{stack.stack_id}} + {{stack.details}} + {% endif %} + {{switch}} + {% if forloop.first %} + + + + + {% if is_infra %} + + + + + + + {% endif %} + + {% endif %} + + {% empty %} + + {{stack.name}} + {{stack.stack_id}} + {{stack.details}} + Aucun + + + + + {% if is_infra %} + + + + + + + {% endif %} + + {% endfor %} + + {% endfor %} diff --git a/topologie/views.py b/topologie/views.py index f3dedff8..9fe37d6f 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -211,6 +211,8 @@ def new_stack(request): messages.success(request, "Stack crée") except: messages.error(request, "Cette stack existe déjà") + else: + return redirect('/topologie/index_stack') return form({'topoform':stack}, 'topologie/topo.html', request)