mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -92,9 +92,9 @@ def repo_comment_handler(
|
||||
repo_name = payload["repository"]["name"].tame(check_string)
|
||||
topic_name = BITBUCKET_TOPIC_TEMPLATE.format(repository_name=repo_name)
|
||||
sha = payload["commit"].tame(check_string)
|
||||
commit_url = payload["repository"]["links"]["self"][0]["href"].tame(check_string)[
|
||||
: -len("browse")
|
||||
]
|
||||
commit_url = (
|
||||
payload["repository"]["links"]["self"][0]["href"].tame(check_string).removesuffix("browse")
|
||||
)
|
||||
commit_url += f"commits/{sha}"
|
||||
message = payload["comment"]["text"].tame(check_string)
|
||||
if action == "deleted their comment":
|
||||
|
||||
Reference in New Issue
Block a user