From a89f02b92bc26fb4cf2158374d67c007af8aa003 Mon Sep 17 00:00:00 2001 From: Kyle Gabriel Date: Fri, 11 Oct 2024 07:44:49 -0400 Subject: [PATCH] Fix crudini issue --- mycodo/config.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mycodo/config.py b/mycodo/config.py index 24aaa6410..b3ef17d6e 100644 --- a/mycodo/config.py +++ b/mycodo/config.py @@ -48,8 +48,11 @@ except: MYCODO_DB_PATH = f'sqlite:///{SQL_DATABASE_MYCODO}' -cmd = f'/opt/Mycodo/env/bin/crudini --set /opt/Mycodo/alembic_db/alembic.ini alembic sqlalchemy.url {MYCODO_DB_PATH}' -subprocess.Popen(cmd, shell=True) +try: + cmd = f'/opt/Mycodo/env/bin/crudini --set /opt/Mycodo/alembic_db/alembic.ini alembic sqlalchemy.url {MYCODO_DB_PATH}' + subprocess.Popen(cmd, shell=True) +except: + pass # Misc paths PATH_1WIRE = '/sys/bus/w1/devices/' @@ -540,11 +543,7 @@ class ProdConfig(object): """Production Configuration.""" - try: - SQLALCHEMY_DATABASE_URI = config_override.MYCODO_DB_PATH - except: - SQLALCHEMY_DATABASE_URI = MYCODO_DB_PATH - + SQLALCHEMY_DATABASE_URI = MYCODO_DB_PATH SQLALCHEMY_TRACK_MODIFICATIONS = False FLASK_PROFILER = {