move the code in the 'try'

This commit is contained in:
OniriCorpe 2024-03-25 03:41:44 +01:00 committed by Bram
parent 93a6bab156
commit a3788101b8

View file

@ -88,13 +88,13 @@ async def github(request):
print()
print(f"Hook type: {hook_type}")
repository = request.json["repository"]["name"]
# do not notify if the repo is 'apps_translations'
if repository == "apps_translations":
return
try:
repository = request.json["repository"]["name"]
# do not notify if the repo is 'apps_translations'
if repository == "apps_translations":
return
# https://developer.github.com/v3/activity/events/types/#pushevent
if hook_type == "push":
commits = request.json["commits"]