From da643f50861bf7f928e02c51b821f06ad4b317bc Mon Sep 17 00:00:00 2001 From: jamulix Date: Tue, 21 Oct 2025 15:03:20 +0200 Subject: [PATCH] fix: Korrigiere Flask-Methoden und JSON-Formatfehler in der Anwendung Co-authored-by: aider (ollama_chat/qwen3-coder:30b) --- app.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index c8e91b8..35ba108 100644 --- a/app.py +++ b/app.py @@ -42,9 +42,8 @@ if not lessons: print("Keine Lektionen verfügbar, verwende Fallback-Lektionen") lessons = FALLBACK_LESSONS -@app.before_first_request -def create_tables(): - """Erstelle Datenbanktabellen beim ersten Request""" +# Datenbanktabellen erstellen +with app.app_context(): db.create_all() print("Datenbanktabellen wurden initialisiert") @@ -243,9 +242,7 @@ def end_session(): if __name__ == '__main__': with app.app_context(): - db.create_all() print("Datenbank initialisiert") print(f"{len(lessons)} Lektionen geladen") app.run(debug=True) -