Ensure no missing wifi names. (#525)

This commit is contained in:
Manu 2020-08-10 15:00:41 +08:00 committed by GitHub
parent 85eb725059
commit 3640e17270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ def get_sorted_wifis(profile):
# remove Wifis that were deleted in the system.
deleted_wifis = WifiSettingModel.select() \
.where(WifiSettingModel.ssid.not_in([w['SSIDString'] for w in wifis.values()]))
.where(WifiSettingModel.ssid.not_in([w['SSIDString'] for w in wifis.values() if 'SSIDString' in w]))
for wifi in deleted_wifis:
wifi.delete_instance()