From 78f29fc9f65ecc9a282dd82afaf6e3a661440fde Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Tue, 11 Jul 2023 23:38:08 +0800 Subject: [PATCH] fix: gitea get team by name not found --- joint_teapot/workers/gitea.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/joint_teapot/workers/gitea.py b/joint_teapot/workers/gitea.py index e66286d..a8621af 100644 --- a/joint_teapot/workers/gitea.py +++ b/joint_teapot/workers/gitea.py @@ -62,7 +62,7 @@ class Gitea: @lru_cache() def _get_team_id_by_name(self, name: str) -> int: res = self.organization_api.team_search(self.org_name, q=str(name), limit=1) - if len(res["data"]) == 0: + if len(res["data"] or []) == 0: raise Exception(f"{name} not found by name in Gitea") return res["data"][0]["id"] @@ -339,7 +339,7 @@ class Gitea: repo_name, body={"title": title, "body": body, "assignees": assignees}, ) - logger.info(f"Created issue \"{title}\" in {repo_name}") + logger.info(f'Created issue "{title}" in {repo_name}') def create_milestone( self,