networks: Fix display of mangled SSIDs when scanning Wi-Fi networks

In the list of Wi-Fi networks shown after scanning, the SSID shows as "b'myap'"
instead of "myap". Fix this.

Tests:

- On a machine with Wi-Fi network device, scan of Wi-Fi networks. Without the
patch, incorrect SSID labels show up. With patch, SSID is correct.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-11-04 10:16:12 -08:00 committed by Veiko Aasa
parent bfdb05bf0d
commit 7fa664d445
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -626,7 +626,7 @@ def wifi_scan():
# this is used in the URL it will be escaped properly and
# unescaped when taken as view function's argument.
ssid = access_point.get_ssid()
ssid_string = ssid.get_data() if ssid else ''
ssid_string = ssid.get_data().decode() if ssid else ''
access_points.append({
'interface_name': device.get_iface(),
'ssid': ssid_string,