diff --git a/routes/translate_routes.py b/routes/translate_routes.py index 3f2b478..adcd1b6 100644 --- a/routes/translate_routes.py +++ b/routes/translate_routes.py @@ -532,6 +532,13 @@ async def translate_document_v1( if prompt_id in ("null", "undefined", ""): prompt_id = None if file_url in ("null", "undefined", ""): file_url = None + # Story 3.12 / Bugfix: If user is on the free tier, they might have stale Pro features + # in their frontend localStorage (e.g., they downgraded, or switched accounts). + # Instead of hard-blocking the translation, we simply strip the Pro features. + if tier == "free": + glossary_id = None + custom_prompt = None + prompt_id = None if file_url: if tier == "free": @@ -541,14 +548,6 @@ async def translate_document_v1( details={"feature": "file_url", "tier": tier}, ) - # Story 3.12: Include prompt_id in Pro feature check - if (glossary_id or custom_prompt or prompt_id) and tier == "free": - raise TranslateEndpointError( - code=TranslateEndpointError.PRO_FEATURE_REQUIRED, - message="Glossaries and custom prompts are reserved for Pro users.", - details={"feature": "glossary_id, custom_prompt, or prompt_id", "tier": tier}, - ) - # Story 3.10: Validate glossary access before creating the job if glossary_id and user_id: try: