feat: give hint when failed to find a team (#24)
This commit is contained in:
parent
666d62bc98
commit
c1bf2ecf3a
|
@ -66,7 +66,9 @@ class Gitea:
|
||||||
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"] or []) == 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. Possible reason: you did not join this team."
|
||||||
|
)
|
||||||
return res["data"][0]["id"]
|
return res["data"][0]["id"]
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user