From 7f8a08af7b51f85572975b6b0e615e3176e3d468 Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 17 May 2026 01:24:11 +0200 Subject: [PATCH] fix: add source_language to glossary import + expose error details - Set source_language from template data during import - Return actual error message instead of generic one for debugging Co-Authored-By: Claude Opus 4.7 --- routes/glossary_routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/glossary_routes.py b/routes/glossary_routes.py index 7be1734..4865fd1 100644 --- a/routes/glossary_routes.py +++ b/routes/glossary_routes.py @@ -591,6 +591,7 @@ async def import_glossary_template( glossary = Glossary( user_id=user.id, name=glossary_name, + source_language=template_data.get("source_lang", "fr"), created_at=datetime.now(timezone.utc), updated_at=datetime.now(timezone.utc), ) @@ -625,11 +626,11 @@ async def import_glossary_template( }, ) except Exception as e: - logger.error(f"Failed to import glossary template {template_id}: {e}") + logger.error(f"Failed to import glossary template {template_id}: {e}", exc_info=True) return JSONResponse( status_code=500, content={ "error": "IMPORT_ERROR", - "message": "An error occurred while importing the template.", + "message": f"Import failed: {str(e)}", }, )