Fixes for http_enabled.
This commit is contained in:
@@ -35,7 +35,7 @@ async def get_current_http_user(credentials: HTTPBasicCredentials = Depends(secu
|
|||||||
headers={"WWW-Authenticate": "Basic"},
|
headers={"WWW-Authenticate": "Basic"},
|
||||||
)
|
)
|
||||||
|
|
||||||
if not user.enabled:
|
if not user.http_enabled:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_403_FORBIDDEN,
|
status_code=status.HTTP_403_FORBIDDEN,
|
||||||
detail="HTTP access disabled for this user",
|
detail="HTTP access disabled for this user",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ async def profile(current_user: HttpUser = Depends(get_current_http_user)):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
**safe_profile,
|
**safe_profile,
|
||||||
"http_enabled": current_user.enabled,
|
"http_enabled": current_user.http_enabled,
|
||||||
"rf_enabled": rf_enabled,
|
"rf_enabled": rf_enabled,
|
||||||
"http_created_at": current_user.created_at,
|
"http_created_at": current_user.created_at,
|
||||||
"http_last_login": current_user.last_login,
|
"http_last_login": current_user.last_login,
|
||||||
|
|||||||
Reference in New Issue
Block a user