Skip to content

Commit

Permalink
Fix empty return triggering error 500, gotta use empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Nov 23, 2024
1 parent e52fa4e commit 65b51eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import asyncio

from sanic import Sanic
from sanic.response import text
from sanic.response import text, empty
from sanic.exceptions import abort


Expand Down Expand Up @@ -143,10 +143,10 @@ def user_noping(user: str) -> str:

# do not notify if the repo is 'apps_translations'
if repository == "apps_translations":
return
return empty()
# for apps repo, only notify for apps that are in the hardcoded most popular apps
elif repository.endswith("_ynh") and hook_type != "repository" and repository not in MOST_POPULAR_APPS:
return
return empty()

# https://developer.github.com/v3/activity/events/types/#pushevent
if hook_type == "push":
Expand All @@ -155,7 +155,7 @@ def user_noping(user: str) -> str:

# Ignore yunohost-bot and github bot, too much noise
if user in ["yunohost-bot", "github-actions[bot]"]:
return
return empty()

user = user_noping(user)

Expand Down Expand Up @@ -218,7 +218,7 @@ def user_noping(user: str) -> str:

# Ignore yunohost-bot and github bot, too much noise
if user in ["yunohost-bot", "github-actions[bot]"]:
return
return empty()

user = user_noping(user)

Expand Down Expand Up @@ -270,7 +270,7 @@ def user_noping(user: str) -> str:

# Ignore yunohost-bot and github bot, too much noise
if user in ["yunohost-bot", "github-actions[bot]"]:
return
return empty()

user = user_noping(user)

Expand All @@ -282,7 +282,7 @@ def user_noping(user: str) -> str:

# Don't notify the !testme comments
if comment.strip().startswith("!testme"):
return
return empty()

if len(comment) > 120:
comment = comment[:120] + "..."
Expand Down

0 comments on commit 65b51eb

Please sign in to comment.