Skip to content

Commit ed6ef63

Browse files
committed
use dict.get to make code more rebust
1 parent a378810 commit ed6ef63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def github(request):
8989
print(f"Hook type: {hook_type}")
9090

9191
try:
92-
repository = request.json["repository"]["name"]
92+
repository = request.json.get("repository", {}).get("name")
9393

9494
# do not notify if the repo is 'apps_translations'
9595
if repository == "apps_translations":

0 commit comments

Comments
 (0)