Spaces:
Running
Running
fix: For unauthorized user get_user_details returns UserDetails with name=None
Browse files
huggingface_overlay/start_HuggingFace.py
CHANGED
|
@@ -265,16 +265,16 @@ if IS_HUGGINGFACE_SPACE:
|
|
| 265 |
exc_info=True,
|
| 266 |
)
|
| 267 |
# Return unauthenticated
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 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,
|
|
|
|
| 265 |
exc_info=True,
|
| 266 |
)
|
| 267 |
# Return unauthenticated
|
| 268 |
+
return api_router.UserDetails(
|
| 269 |
+
# name="anonymous",
|
| 270 |
+
name=None,
|
| 271 |
+
permissions=api_router.Permissions(
|
| 272 |
+
read=any_user_can_read,
|
| 273 |
+
write=False,
|
| 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,
|