mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
use dict.get to make code more rebust
This commit is contained in:
parent
a3788101b8
commit
ed6ef63d41
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ async def github(request):
|
||||||
print(f"Hook type: {hook_type}")
|
print(f"Hook type: {hook_type}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
repository = request.json["repository"]["name"]
|
repository = request.json.get("repository", {}).get("name")
|
||||||
|
|
||||||
# do not notify if the repo is 'apps_translations'
|
# do not notify if the repo is 'apps_translations'
|
||||||
if repository == "apps_translations":
|
if repository == "apps_translations":
|
||||||
|
|
Loading…
Add table
Reference in a new issue