Upgrade DB fixes + NTFY fix

This commit is contained in:
Jokob-sk
2023-06-10 10:57:26 +10:00
parent 5867961383
commit 67c20cabc3
4 changed files with 9 additions and 7 deletions

View File

@@ -135,7 +135,7 @@ class DB():
"""
Check the current tables in the DB and upgrade them if neccessary
"""
# indicates, if Online_History table is available
onlineHistoryAvailable = self.sql.execute("""
SELECT name FROM sqlite_master WHERE type='table'
@@ -146,7 +146,7 @@ class DB():
isIncompatible = False
if onlineHistoryAvailable :
isIncompatible = sql.execute ("""
isIncompatible = self.sql.execute ("""
SELECT COUNT(*) AS CNTREC FROM pragma_table_info('Online_History') WHERE name='Archived_Devices'
""").fetchone()[0] == 0
@@ -182,7 +182,7 @@ class DB():
""")
# dev_Network_Node_port column
dev_Network_Node_port_missing = sql.execute ("""
dev_Network_Node_port_missing = self.sql.execute ("""
SELECT COUNT(*) AS CNTREC FROM pragma_table_info('Devices') WHERE name='dev_Network_Node_port'
""").fetchone()[0] == 0

View File

@@ -34,7 +34,7 @@ def send (msg: noti_struc):
try:
requests.post("{}/{}".format( conf.NTFY_HOST, conf.NTFY_TOPIC),
data=msg.html,
data=msg.text,
headers=headers)
except requests.exceptions.RequestException as e:
mylog('none', ['[NTFY] Error: ', e])