mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
ruff: Fix PERF401 Use a list comprehension to create a transformed list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
0b95d83f09
commit
562a79ab76
@@ -82,9 +82,7 @@ def get_assignee_string(assignees: List[Dict[str, Any]]) -> str:
|
||||
if len(assignees) == 1:
|
||||
assignees_string = "{username}".format(**assignees[0])
|
||||
else:
|
||||
usernames = []
|
||||
for a in assignees:
|
||||
usernames.append(a["username"])
|
||||
usernames = [a["username"] for a in assignees]
|
||||
|
||||
assignees_string = ", ".join(usernames[:-1]) + " and " + usernames[-1]
|
||||
return assignees_string
|
||||
|
||||
Reference in New Issue
Block a user