mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-11 15:26:19 +00:00
fix: Configuration creation bug due to failed Nonetype checking
This commit is contained in:
@@ -135,6 +135,8 @@ class DashboardConfig:
|
||||
]
|
||||
|
||||
for table_name in tables_to_check:
|
||||
if not table_name:
|
||||
continue
|
||||
if not inspector.has_table(table_name):
|
||||
continue
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import configparser
|
||||
import os
|
||||
from sqlalchemy_utils import database_exists, create_database
|
||||
from flask import current_app
|
||||
|
||||
def ConnectionString(database) -> str:
|
||||
parser = configparser.ConfigParser(strict=False)
|
||||
@@ -20,9 +19,7 @@ def ConnectionString(database) -> str:
|
||||
try:
|
||||
if not database_exists(cn):
|
||||
create_database(cn)
|
||||
current_app.logger.info(f"Database {database} created.")
|
||||
except Exception as e:
|
||||
current_app.logger.error("Database error. Terminating...", e)
|
||||
exit(1)
|
||||
|
||||
return cn
|
||||
Reference in New Issue
Block a user