refactor: consolidate get_db into single module

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-09 15:37:23 +00:00
parent cd6fd95d50
commit 98cf9e0e0b
5 changed files with 6 additions and 30 deletions
+1 -12
View File
@@ -11,7 +11,7 @@ from sqlalchemy.orm import Session # noqa: F401
from app.auth import require_login # noqa: F401
from app.config import settings
from app.database import SessionLocal
from app.database import get_db # noqa: F401
# Set up Jinja2 templates
templates_dir = Path(__file__).parent.parent.parent / "frontend" / "templates"
@@ -39,14 +39,3 @@ templates.TemplateResponse = template_response_with_version
# Set up logging
logger = logging.getLogger(__name__)
def get_db():
"""
Dependency to get a database session.
"""
db = SessionLocal()
try:
yield db
finally:
db.close()