restructured
This commit is contained in:
+3
-6
@@ -315,12 +315,9 @@ def api_room_whoami(
|
||||
room_id: int,
|
||||
user_id: int = Depends(get_current_user),
|
||||
):
|
||||
role = whoami(
|
||||
room_id,
|
||||
user_id,
|
||||
)
|
||||
permissions = whoami(room_id, user_id)
|
||||
|
||||
if role is None:
|
||||
if not permissions["member"]:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="not a room member",
|
||||
@@ -329,7 +326,7 @@ def api_room_whoami(
|
||||
return {
|
||||
"room_id": room_id,
|
||||
"user_id": user_id,
|
||||
"role": role,
|
||||
**permissions,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user