mirror of
https://github.com/zulip/zulip.git
synced 2025-11-22 07:21:23 +00:00
ruff: Fix RUF015 Prefer next(...) over single element slice.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 3b09197fdf)
This commit is contained in:
committed by
Alex Vandiver
parent
a0ce536fa4
commit
b9aa772885
@@ -623,10 +623,10 @@ def get_user_groups(client: Client) -> int:
|
||||
# {code_example|end}
|
||||
|
||||
validate_against_openapi_schema(result, "/user_groups", "get", "200")
|
||||
hamlet_user_group = [u for u in result["user_groups"] if u["name"] == "hamletcharacters"][0]
|
||||
[hamlet_user_group] = (u for u in result["user_groups"] if u["name"] == "hamletcharacters")
|
||||
assert hamlet_user_group["description"] == "Characters of Hamlet"
|
||||
|
||||
marketing_user_group = [u for u in result["user_groups"] if u["name"] == "marketing"][0]
|
||||
[marketing_user_group] = (u for u in result["user_groups"] if u["name"] == "marketing")
|
||||
return marketing_user_group["id"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user