fix: add source_language to glossary import + expose error details
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 52s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 52s
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)}",
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user