mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[fix] comment can be None
This commit is contained in:
parent
5d921a87e9
commit
692117f7af
1 changed files with 3 additions and 3 deletions
|
@ -213,13 +213,13 @@ async def github(request):
|
|||
|
||||
if action == "submitted":
|
||||
state = request.json["review"]["state"]
|
||||
comment = request.json["review"]["body"].replace("\r\n", " ")
|
||||
comment = request.json["review"]["body"]
|
||||
if comment and len(comment) > 120:
|
||||
comment = ": " + comment[:120] + "..."
|
||||
comment = ": " + comment[:120].replace("\r\n", " ") + "..."
|
||||
elif not comment:
|
||||
comment = ""
|
||||
else:
|
||||
comment = ": " + comment
|
||||
comment = ": " + comment.replace("\r\n", " ")
|
||||
|
||||
notify(f"[{repository}] @{user} {state} pull request #{pull_request_number} {pull_request_title}{comment} {url}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue