Spaces:
Running
Running
fix: For unauthorized user get_user_details return None instead of raising error
Browse files
huggingface_overlay/start_HuggingFace.py
CHANGED
|
@@ -274,11 +274,12 @@ if IS_HUGGINGFACE_SPACE:
|
|
| 274 |
# admin=False,
|
| 275 |
# ),
|
| 276 |
# )
|
| 277 |
-
|
| 278 |
-
raise
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
|
|
|
| 282 |
|
| 283 |
else:
|
| 284 |
# We're not in space.
|
|
|
|
| 274 |
# admin=False,
|
| 275 |
# ),
|
| 276 |
# )
|
| 277 |
+
return None
|
| 278 |
+
# We cannot raise error here. /api/pipeline_runs/ route depends on get_user_name
|
| 279 |
+
# raise fastapi.HTTPException(
|
| 280 |
+
# status_code=fastapi.status.HTTP_401_UNAUTHORIZED,
|
| 281 |
+
# detail="Unauthenticated",
|
| 282 |
+
# )
|
| 283 |
|
| 284 |
else:
|
| 285 |
# We're not in space.
|