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
@@ -14,16 +14,15 @@ from zerver.models import UserProfile
|
||||
|
||||
|
||||
def get_push_commits_body(payload: WildValue) -> str:
|
||||
commits_data = []
|
||||
for commit in payload["event"]["push"]["commits"]:
|
||||
commits_data.append(
|
||||
{
|
||||
"name": commit["author"].tame(check_string),
|
||||
"sha": commit["raw_id"].tame(check_string),
|
||||
"url": commit["url"].tame(check_string),
|
||||
"message": commit["message"].tame(check_string),
|
||||
}
|
||||
)
|
||||
commits_data = [
|
||||
{
|
||||
"name": commit["author"].tame(check_string),
|
||||
"sha": commit["raw_id"].tame(check_string),
|
||||
"url": commit["url"].tame(check_string),
|
||||
"message": commit["message"].tame(check_string),
|
||||
}
|
||||
for commit in payload["event"]["push"]["commits"]
|
||||
]
|
||||
return get_push_commits_event_message(
|
||||
get_user_name(payload),
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user