Skip to content

Commit

Permalink
Fix crudini issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Oct 11, 2024
1 parent f9abdc3 commit a89f02b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions mycodo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit a89f02b

Please sign in to comment.