Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @contextmanager | ||
| def get_session() -> Iterator[Session]: | ||
| session = SessionLocal() | ||
| try: | ||
| yield session | ||
| session.commit() |
There was a problem hiding this comment.
Remove @contextmanager from FastAPI session dependency
get_session is decorated with @contextmanager, so Depends(get_session) injects the context-manager object rather than a SQLAlchemy Session. Any endpoint that tries to use session.add/session.commit will crash with AttributeError, and the underlying session is never entered or closed. Define the dependency as a plain generator (no decorator) or split the context manager into a separate helper so API routes receive a real session.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f7c2535b7083319dc0528c56914889