From 5eda78a3183d1d58bb5cb4e4d04b3bfa103d6dd6 Mon Sep 17 00:00:00 2001 From: Daniel Steglich Date: Thu, 13 Aug 2015 23:06:40 +0200 Subject: [PATCH] Fixed regression on editing Ethernet connections During implementation of PPPoE based connections I added Username and Password fields. This fileds are only required when editing a PPPoE connection. --- plinth/modules/networks/networks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plinth/modules/networks/networks.py b/plinth/modules/networks/networks.py index a7e7cd029..f1f92b3ee 100644 --- a/plinth/modules/networks/networks.py +++ b/plinth/modules/networks/networks.py @@ -80,10 +80,12 @@ def edit(request, uuid): name = form.cleaned_data['name'] interface = form.cleaned_data['interface'] zone = form.cleaned_data['zone'] - ipv4_method = form.cleaned_data['ipv4_method'] - ipv4_address = form.cleaned_data['ipv4_address'] - username = form.cleaned_data['username'] - password = form.cleaned_data['password'] + if connection.get_connection_type() == 'pppoe': + username = form.cleaned_data['username'] + password = form.cleaned_data['password'] + else: + ipv4_method = form.cleaned_data['ipv4_method'] + ipv4_address = form.cleaned_data['ipv4_address'] if connection.get_connection_type() == '802-3-ethernet': network.edit_ethernet_connection(