From f065b830e9858b98af248a14c8bdbe963fa3ff0f Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Wed, 26 Jun 2024 11:46:45 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8COMADA=20work=20#708?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/plugins/__template/rename_me.py | 2 +- server/device.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/front/plugins/__template/rename_me.py b/front/plugins/__template/rename_me.py index 597b4eb36..05e52dd85 100755 --- a/front/plugins/__template/rename_me.py +++ b/front/plugins/__template/rename_me.py @@ -34,7 +34,7 @@ def main(): # Retrieve configuration settings some_setting = get_setting_value('SYNC_plugins') - mylog('verbose', [f'[{pluginName}] some_setting calue {some_setting}']) + mylog('verbose', [f'[{pluginName}] some_setting value {some_setting}']) # retrieve data device_data = get_device_data(some_setting) diff --git a/server/device.py b/server/device.py index 0f06ed811..a4bdd393b 100755 --- a/server/device.py +++ b/server/device.py @@ -275,7 +275,7 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_Vendor = "" OR dev_Vendor IS NULL) + (dev_Vendor IS NULL OR dev_Vendor IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan @@ -291,7 +291,7 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_Network_Node_port = "" OR dev_Network_Node_port IS NULL) + (dev_Network_Node_port IS NULL OR dev_Network_Node_port IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan @@ -307,14 +307,14 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_Network_Node_MAC_ADDR = "" OR dev_Network_Node_MAC_ADDR IS NULL) + (dev_Network_Node_MAC_ADDR IS NULL OR dev_Network_Node_MAC_ADDR IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan WHERE dev_MAC = cur_MAC )""") - # Update only devices with empty or NULL dev_Network_Node_MAC_ADDR + # Update only devices with empty or NULL dev_NetworkSite mylog('debug', '[Update Devices] - 3 cur_NetworkSite -> dev_NetworkSite') sql.execute("""UPDATE Devices SET dev_NetworkSite = ( @@ -323,7 +323,7 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_NetworkSite = "" OR dev_NetworkSite IS NULL) + (dev_NetworkSite IS NULL OR dev_NetworkSite IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan @@ -339,7 +339,7 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_SSID = "" OR dev_SSID IS NULL) + (dev_SSID IS NULL OR dev_SSID IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan @@ -355,7 +355,7 @@ def update_devices_data_from_scan (db): WHERE dev_MAC = cur_MAC ) WHERE - (dev_DeviceType = "" OR dev_DeviceType IS NULL) + (dev_DeviceType IS NULL OR dev_DeviceType IN ("", "null")) AND EXISTS ( SELECT 1 FROM CurrentScan