fix: gitea get team by name not found
This commit is contained in:
parent
2303cf71a2
commit
78f29fc9f6
|
@ -62,7 +62,7 @@ class Gitea:
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
def _get_team_id_by_name(self, name: str) -> int:
|
def _get_team_id_by_name(self, name: str) -> int:
|
||||||
res = self.organization_api.team_search(self.org_name, q=str(name), limit=1)
|
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")
|
raise Exception(f"{name} not found by name in Gitea")
|
||||||
return res["data"][0]["id"]
|
return res["data"][0]["id"]
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ class Gitea:
|
||||||
repo_name,
|
repo_name,
|
||||||
body={"title": title, "body": body, "assignees": assignees},
|
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(
|
def create_milestone(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user