Merge pull request 'fix(query): use db.session.get for Adresse in danke() to avoid SQLAlchemy LegacyAPIWarning' (#1) from fix/query-get into main

Reviewed-on: #1
This commit is contained in:
2025-11-10 20:19:11 +01:00

3
app.py
View File

@@ -129,7 +129,8 @@ def index():
@app.route('/danke')
def danke():
id = request.args.get('id')
adresse = Adresse.query.get(id)
# Use session.get to avoid SQLAlchemy LegacyAPIWarning and cast id to int if present
adresse = db.session.get(Adresse, int(id)) if id else None
return render_template('danke.html', adresse=adresse)