From c238a9a2fa2dac6febc8bd5a5b01ac3bd25732cd Mon Sep 17 00:00:00 2001 From: klafyvel Date: Sun, 30 Dec 2018 14:31:36 +0100 Subject: [PATCH] Remove useless variable in create_ports and give explicit name to `s_end`. --- topologie/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/topologie/views.py b/topologie/views.py index d852177d..89d48b0b 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -535,11 +535,10 @@ def create_ports(request, switchid): return redirect(reverse('topologie:index')) first_port = getattr(switch.ports.order_by('port').first(), 'port', 1) - s_begin = first_port - s_end = switch.number + first_port - 1 + last_port = switch.number + first_port - 1 port_form = CreatePortsForm( request.POST or None, - initial={'begin': s_begin, 'end': s_end} + initial={'begin': first_port, 'end': last_port} ) if port_form.is_valid(): begin = port_form.cleaned_data['begin']