We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f204f2 commit 2bcb981Copy full SHA for 2bcb981
scripts/cwa_db.py
@@ -233,6 +233,9 @@ def set_default_settings(self, force=False) -> None:
233
def get_cwa_settings(self) -> dict:
234
"""Gets the current cwa_settings values from the table of the same name in cwa.db and returns them as a dict"""
235
self.cur.execute("SELECT * FROM cwa_settings")
236
+ if self.cur.fetchall() == []: # If settings table is empty, populates it with default values
237
+ self.cur.execute("INSERT INTO cwa_settings DEFAULT VALUES;")
238
+ self.con.commit()
239
headers = [header[0] for header in self.cur.description]
240
cwa_settings = [dict(zip(headers,row)) for row in self.cur.fetchall()][0]
241
0 commit comments