From 25de3e753d4b1a6256f7129db5a6ce1ff040ded2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 22 Aug 2024 16:34:12 +0200 Subject: [PATCH] fix --- backend/apps/webui/internal/db.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/apps/webui/internal/db.py b/backend/apps/webui/internal/db.py index 2d778bfe1..e30e3c2b3 100644 --- a/backend/apps/webui/internal/db.py +++ b/backend/apps/webui/internal/db.py @@ -54,11 +54,10 @@ else: # Workaround to handle the peewee migration # This is required to ensure the peewee migration is handled before the alembic migration def handle_peewee_migration(DATABASE_URL): + # db = None try: # Replace the postgresql:// with postgres:// to handle the peewee migration - db = register_connection( - DATABASE_URL.replace("postgresql://", "postgres://"), unquote_password=True - ) + db = register_connection(DATABASE_URL.replace("postgresql://", "postgres://")) migrate_dir = BACKEND_DIR / "apps" / "webui" / "internal" / "migrations" router = Router(db, logger=log, migrate_dir=migrate_dir) router.run() @@ -67,7 +66,6 @@ def handle_peewee_migration(DATABASE_URL): except Exception as e: log.error(f"Failed to initialize the database connection: {e}") raise - finally: # Properly closing the database connection if db and not db.is_closed():