Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
eed5937
1
Parent(s): 37e1476
fix: harden workspace ID parsing to prevent intermittent 500 errors
Browse files139 unmodified lines140141142143144145146139 unmodified lines)from uuid import UUIDsetattr(user, "workspace_id", UUID(active_ws_id) if active_ws_id else None)setattr(user, "role", active_role or user.role) # Preserve injected role if availablereturn user139 unmodified lines140141142143144145146147148149150151152153139 unmodified lines)from uuid import UUID# Safely parse active_ws_id, handling "null"/"undefined" strings from frontendws_id = Noneif active_ws_id and active_ws_id not in ("null", "undefined"):try:ws_id = UUID(active_ws_id)except (ValueError, TypeError):passsetattr(user, "workspace_id", ws_id)setattr(user, "role", active_role or user.role) # Preserve injected role if availablereturn user
core/deps.py+8-1