mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
networks: fix for primary connection Closes: #334
Check if there is any primary connection available before accessing this connections parameter. Otherwise Plinth will raise an exception because of non existing object.
This commit is contained in:
parent
5af50fcbe3
commit
8e4abf282f
@ -102,7 +102,9 @@ def get_status_from_connection(connection):
|
|||||||
status['wireless']['ssid'] = setting_wireless.get_ssid().get_data()
|
status['wireless']['ssid'] = setting_wireless.get_ssid().get_data()
|
||||||
|
|
||||||
primary_connection = nm.Client.new(None).get_primary_connection()
|
primary_connection = nm.Client.new(None).get_primary_connection()
|
||||||
status['primary'] = (primary_connection.get_uuid() == connection.get_uuid())
|
if primary_connection:
|
||||||
|
status['primary'] = (primary_connection.get_uuid() ==
|
||||||
|
connection.get_uuid())
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user