From 423aa320774f4cc3e145f846533b72759635f38f Mon Sep 17 00:00:00 2001 From: drunkendog Date: Tue, 26 Sep 2023 02:01:37 +0100 Subject: [PATCH] Make dictionary key explicitly tuple --- api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.py b/api.py index a2bdba6..a404bba 100644 --- a/api.py +++ b/api.py @@ -40,7 +40,7 @@ async def set_badge(repo: str, new_badge: str, branch: str=None, action: str=Non ) if branch is not None or action is not None: - badge_dict[repo, branch, action] = new_badge + badge_dict[(repo, branch, action)] = new_badge else: badge_dict[repo] = new_badge with open("badges.yaml", "w") as f: @@ -54,4 +54,4 @@ async def get_badge(repo: str, branch: str=None, action: str=None): status_code=status.HTTP_404_NOT_FOUND, detail="Badge not found", ) - return RedirectResponse("https://img.shields.io/badge/" + (badge_dict[repo, branch, action] if branch is not None or action is not None else badge_dict[repo])) + return RedirectResponse("https://img.shields.io/badge/" + (badge_dict[(repo, branch, action)] if branch is not None or action is not None else badge_dict[repo]))