mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
5ea78f6e28
commit
66e19ff56e
@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<span class="primary">{% trans "Mode" %}</span>
|
||||
<span class="secondary">{{ device.wireless.mode_string }}</span>
|
||||
<span class="secondary">{{ connection.wireless.mode_string }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if access_point.channel %}
|
||||
|
||||
@ -187,7 +187,8 @@ def show(request, uuid):
|
||||
device, connection_status['wireless']['ssid'])
|
||||
connection_status['wireless'][
|
||||
'mode_string'] = WIRELESS_MODE_STRINGS.get(
|
||||
connection['wireless']['mode'], connection['wireless']['mode'])
|
||||
connection_status['wireless']['mode'],
|
||||
connection_status['wireless']['mode'])
|
||||
|
||||
return TemplateResponse(
|
||||
request, 'connection_show.html', {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user