From da85cd9254f64e688ce62c3ebda363ff1ca0f0a8 Mon Sep 17 00:00:00 2001 From: LEVY-FALK Hugo Date: Thu, 26 Oct 2017 11:51:41 +0200 Subject: [PATCH] =?UTF-8?q?Moins=20de=20requ=C3=AAtes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/topologie/views.py b/topologie/views.py index dcfce4d9..bad4d246 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -425,9 +425,9 @@ def create_ports(request, switch_id): s_begin = s_end = 0 nb_ports = switch.ports.count() if nb_ports > 0: - ports = switch.ports.order_by('port') - s_begin = ports[0].port - s_end = ports.last().port + ports = switch.ports.order_by('port').values('port') + s_begin = ports.first().get('port') + s_end = ports.last().get('port') port_form = CreatePortsForm( request.POST or None,