Ark-kun commited on
Commit
5c46926
·
1 Parent(s): 1b5e9d9

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
- # return None
278
- raise fastapi.HTTPException(
279
- status_code=fastapi.status.HTTP_401_UNAUTHORIZED,
280
- detail="Unauthenticated",
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.