From 22bfab0c434a55cc81f0159fe2204d412064345c Mon Sep 17 00:00:00 2001 From: Enrico Ludwig Date: Thu, 1 Aug 2024 17:40:47 +0200 Subject: [PATCH 1/2] Allowing case-insensitive name in get_team --- gitea/apiobject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitea/apiobject.py b/gitea/apiobject.py index 209f9fc..271cf95 100644 --- a/gitea/apiobject.py +++ b/gitea/apiobject.py @@ -119,10 +119,10 @@ class Organization(ApiObject): setattr(t, "_organization", self) return teams - def get_team(self, name) -> "Team": + def get_team(self, name, ignore_case : bool = False) -> "Team": teams = self.get_teams() for team in teams: - if team.name == name: + if (not ignore_case and team.name == name) or (ignore_case and team.name.lower() == name.lower()): return team raise NotFoundException("Team not existent in organization.") From 103137686e5c863cb22d8ba08d1006a38f248def Mon Sep 17 00:00:00 2001 From: Enrico Ludwig Date: Thu, 1 Aug 2024 17:44:21 +0200 Subject: [PATCH 2/2] Added units_map to create_team function as it's part of the Gitea API at least for version 1.22.1 --- gitea/gitea.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gitea/gitea.py b/gitea/gitea.py index 81f7b07..ccb419d 100644 --- a/gitea/gitea.py +++ b/gitea/gitea.py @@ -352,6 +352,15 @@ class Gitea: "repo.releases", "repo.ext_wiki", ), + units_map: Dict[str, str] = { + "repo.code": "none", + "repo.issues": "none", + "repo.ext_issues": "none", + "repo.wiki": "none", + "repo.pulls": "none", + "repo.releases": "none", + "repo.ext_wiki": "none", + }, ): """Creates a Team. @@ -370,6 +379,7 @@ class Gitea: "can_create_org_repo": can_create_org_repo, "includes_all_repositories": includes_all_repositories, "units": units, + "units_map": units_map, }, ) if "id" in result: