8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-30 08:32:26 +00:00

Remove useless variable in create_ports and give explicit name to s_end.

This commit is contained in:
klafyvel 2018-12-30 14:31:36 +01:00
parent 7ddb627b6b
commit c238a9a2fa

View file

@ -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']