From 34e16c15536b8fa23a3422f17b73429a7f6e3376 Mon Sep 17 00:00:00 2001 From: dhruv302003 Date: Sat, 3 Jun 2023 18:02:42 +0530 Subject: [PATCH] integrations: Refactor Github Integration to use get_sender_name. --- zerver/webhooks/github/view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/webhooks/github/view.py b/zerver/webhooks/github/view.py index c08b2269b4..dbc284684f 100644 --- a/zerver/webhooks/github/view.py +++ b/zerver/webhooks/github/view.py @@ -364,7 +364,7 @@ def get_team_body(helper: Helper) -> str: payload = helper.payload changes = payload["changes"] if "description" in changes: - actor = payload["sender"]["login"].tame(check_string) + actor = get_sender_name(payload) new_description = payload["team"]["description"].tame(check_string) return f"**{actor}** changed the team description to:\n```quote\n{new_description}\n```" if "name" in changes: @@ -599,7 +599,7 @@ def get_star_body(helper: Helper) -> str: payload = helper.payload template = "[{user}]({user_url}) {action} the repository [{repo}]({url})." return template.format( - user=payload["sender"]["login"].tame(check_string), + user=get_sender_name(payload), user_url=get_sender_url(payload), action="starred" if payload["action"].tame(check_string) == "created" else "unstarred", repo=get_repository_full_name(payload),