[fix] those duplicated are annoying.

This commit is contained in:
Laurent Peuch 2019-02-20 23:14:58 +01:00
parent f2698baa14
commit 82d0f2ea8b

View file

@ -243,11 +243,12 @@ async def github(request):
else: else:
comment = ": " + comment.replace("\r\n", " ") comment = ": " + comment.replace("\r\n", " ")
# to avoid duplicated with pull_request_review_comment event
if state == "commented" and not comment:
pass
else:
notify(f"[{repository}] @{user} {state} pull request #{pull_request_number} {pull_request_title}{comment} {url}", repository=repository) notify(f"[{repository}] @{user} {state} pull request #{pull_request_number} {pull_request_title}{comment} {url}", repository=repository)
# to avoid duplicated with pull_request_review_comment event
elif action == "commented":
pass
else: else:
notify(f"[{repository}] @{user} {action} review pull request #{pull_request_number}: {pull_request_title} {url}", repository=repository) notify(f"[{repository}] @{user} {action} review pull request #{pull_request_number}: {pull_request_title} {url}", repository=repository)