integrations: Refactor Github Integration to use get_sender_name.

This commit is contained in:
dhruv302003 2023-06-03 18:02:42 +05:30 committed by Tim Abbott
parent 67125acaa6
commit 34e16c1553
1 changed files with 2 additions and 2 deletions

View File

@ -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),