Skip to content

Refactor: Update SQLAlchemy syntax to 2.0 to resolve LegacyAPIWarnings#2

Open
nesmomik wants to merge 1 commit intoMasterschool-SWE:mainfrom
nesmomik:fix-sqlalchemy-legacy-warning
Open

Refactor: Update SQLAlchemy syntax to 2.0 to resolve LegacyAPIWarnings#2
nesmomik wants to merge 1 commit intoMasterschool-SWE:mainfrom
nesmomik:fix-sqlalchemy-legacy-warning

Conversation

@nesmomik
Copy link

When testing the RSVP endpoints with pytest a LegacyAPIWarning would show up in the test output.

  • replaced Event.query.get_or_404(event_id) with db.get_or_404(Event, event_id)

  • updated RSVP.query.filter_by(...) to use the explicit db.session.execute(db.select(RSVP)...) pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant