aboutsummaryrefslogtreecommitdiffstats
path: root/models/organization
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-11-27 13:12:26 -0800
committerGitHub <noreply@github.com>2024-11-27 21:12:26 +0000
commitf62f68cbdda07ae6933b4804bc757f35dc92d134 (patch)
tree6709319ec99caa6b22ed7d409f77ad17323f7808 /models/organization
parent5a50b271e71b5e8bb7bdef149e07dcd2b0db3e3a (diff)
downloadgitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.tar.gz
gitea-f62f68cbdda07ae6933b4804bc757f35dc92d134.zip
Move team related functions to service layer (#32537)
There are still some functions under `models` after last big refactor about `models`. This change will move all team related functions to service layer with no code change.
Diffstat (limited to 'models/organization')
-rw-r--r--models/organization/team_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/organization/team_test.go b/models/organization/team_test.go
index 23a6affe24..8c34e7a612 100644
--- a/models/organization/team_test.go
+++ b/models/organization/team_test.go
@@ -197,3 +197,8 @@ func TestUsersInTeamsCount(t *testing.T) {
test([]int64{1, 2, 3, 4, 5}, []int64{2, 5}, 2) // userid 2,4
test([]int64{1, 2, 3, 4, 5}, []int64{2, 3, 5}, 3) // userid 2,4,5
}
+
+func TestIsUsableTeamName(t *testing.T) {
+ assert.NoError(t, organization.IsUsableTeamName("usable"))
+ assert.True(t, db.IsErrNameReserved(organization.IsUsableTeamName("new")))
+}