network: Fix showing wifi connection

Viewing a wifi connection will cause a 500 error.  To reproduce this
issue, go to plinth/sys/networks/.  If no wifi connections exist,
add one use the "Add Connection" button.  Then, click on the name of
the wifi connection to view it.  A 500 error is returned.

This commit fixes this error so the normal "show connection" is
returned.  It also fixes a bytestring conversion error
for the SSID and a blank value for "mode" on the page.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Jim Gregory authored and Sunil Mohan Adapa committed 2022-03-28 15:19:48 -07:00
1 parent 5ea78f6e28
commit 66e19ff56e
3 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -111,7 +111,9 @@ def get_status_from_connection(connection):
if status['type'] == '802-11-wireless':
setting_wireless = connection.get_setting_wireless()
status['wireless']['ssid'] = setting_wireless.get_ssid().get_data()
status['wireless']['ssid'] = setting_wireless.get_ssid().get_data(
).decode()
status['wireless']['mode'] = setting_wireless.get_mode()
return status