From d284ce534acd170d7f93c4b9ac1d227d4abb6bd6 Mon Sep 17 00:00:00 2001 From: Giovanni-Josserand Date: Fri, 29 Aug 2025 23:25:25 +0200 Subject: [PATCH] fix skills router --- database.py | 3 +-- routers/skills.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/database.py b/database.py index a674b6f..a9ec1d0 100644 --- a/database.py +++ b/database.py @@ -13,8 +13,7 @@ def get_db_connection(): passwd=os.getenv("DB_PASS"), host=os.getenv("DB_HOST"), db=os.getenv("DB_NAME"), - charset='utf8mb4', - cursorclass=MySQLdb.cursors.DictCursor + charset='utf8mb4' ) yield conn except MySQLdb.Error as e: diff --git a/routers/skills.py b/routers/skills.py index fca89cb..53d624e 100644 --- a/routers/skills.py +++ b/routers/skills.py @@ -10,7 +10,7 @@ def read_skills(conn = Depends(get_db_connection)): raise HTTPException(status_code=503, detail="Service de base de données indisponible.") try: - with conn.cursor() as cursor: + with conn.cursor(MySQLdb.cursors.DictCursor) as cursor: sql = "SELECT * FROM skills;" cursor.execute(sql) result = cursor.fetchall()