mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
networks: Fix editing wireless connections with SSID field
Fixes: #2447. - When editing an existing wireless connection, SSID field shows as "b'myap'" instead of "myap". Fix this. Tests: - On a machine with a wireless connection, edit the connection. Without the patch, form show SSID incorrectly. With the patch, it shows the correct value. - Unit tests in test_network.py pass when run as root. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
ff4250f24e
commit
bfdb05bf0d
@ -307,7 +307,8 @@ def edit(request, uuid):
|
||||
form = GenericForm(form_data)
|
||||
elif settings_connection.get_connection_type() == '802-11-wireless':
|
||||
settings_wireless = connection.get_setting_wireless()
|
||||
form_data['ssid'] = settings_wireless.get_ssid().get_data()
|
||||
form_data['ssid'] = settings_wireless.get_ssid().get_data().decode(
|
||||
)
|
||||
form_data['mode'] = settings_wireless.get_mode()
|
||||
form_data['band'] = settings_wireless.get_band() or 'auto'
|
||||
form_data['channel'] = settings_wireless.get_channel()
|
||||
|
||||
@ -239,6 +239,8 @@ def test_edit_wifi_connection(network, wifi_uuid):
|
||||
|
||||
settings_wireless = connection.get_setting_wireless()
|
||||
assert settings_wireless.get_ssid().get_data() == b'plinthtestwifi2'
|
||||
assert settings_wireless.get_ssid().get_data().decode(
|
||||
) == 'plinthtestwifi2'
|
||||
assert settings_wireless.get_mode() == 'infrastructure'
|
||||
|
||||
wifi_sec = connection.get_setting_wireless_security()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user