refactor(backend): solve copilot comments

This commit is contained in:
2025-09-24 20:10:31 +02:00
parent 3c8ad5f74f
commit f4892a69d5
12 changed files with 14 additions and 50 deletions

View File

@@ -1,2 +0,0 @@
# Konfigurace a utility

View File

@@ -1,6 +1,6 @@
import os
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker
from app.core.base import Base # Import Base z nového souboru
from app.core.base import Base
DATABASE_URL = os.getenv("DATABASE_URL")
if not DATABASE_URL:
@@ -14,15 +14,11 @@ if not DATABASE_URL:
else:
raise Exception("Only MariaDB is supported. Please set the DATABASE_URL environment variable.")
# Explicitní import všech modelů, aby byly registrovány v Base.metadata
# Load all models to register them
from app.models.user import User
from app.models.transaction import Transaction
from app.models.user import User
# Pokud máš další modely, importuj je zde:
# from app.models.other_model import OtherModel
ssl_enabled = os.getenv("MARIADB_HOST", "localhost") != "localhost"
connect_args = {"ssl": {"ssl": True}} if ssl_enabled else {}

View File

@@ -32,5 +32,4 @@ def enqueue_email(to: str, subject: str, body: str) -> None:
loop.create_task(_publish_async(message))
except RuntimeError:
asyncio.run(_publish_async(message))
# ...existing code...