From fca9462bc717856dc545cc20a7d8a954547e5d25 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 10 Nov 2025 19:49:54 +0100 Subject: [PATCH] fix(query): use db.session.get for Adresse in danke() to avoid SQLAlchemy LegacyAPIWarning --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4997ca7..c3b8a33 100644 --- a/app.py +++ b/app.py @@ -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)