summaryrefslogtreecommitdiffstats
path: root/models/project
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-03-17 22:07:23 +0900
committerGitHub <noreply@github.com>2023-03-17 21:07:23 +0800
commit8e45fcb63aeedcf89a705227fa7675698d68d43c (patch)
tree8facfd85193ff8907673e3e1d1f8e33e27a4c44e /models/project
parent8120c0c20c42f46d08356064c7f7fe96fafcfade (diff)
downloadgitea-8e45fcb63aeedcf89a705227fa7675698d68d43c.tar.gz
gitea-8e45fcb63aeedcf89a705227fa7675698d68d43c.zip
Do not store user projects as organization projects (#23353)
A part of https://github.com/go-gitea/gitea/pull/22865 At first, I think we do not need 3 ProjectTypes, as we can check user type, but it seems that it is not database friendly. --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models/project')
-rw-r--r--models/project/project.go2
-rw-r--r--models/project/project_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/project/project.go b/models/project/project.go
index f3ed723030..679d695881 100644
--- a/models/project/project.go
+++ b/models/project/project.go
@@ -172,7 +172,7 @@ func GetCardConfig() []CardConfig {
// IsTypeValid checks if a project type is valid
func IsTypeValid(p Type) bool {
switch p {
- case TypeRepository, TypeOrganization:
+ case TypeIndividual, TypeRepository, TypeOrganization:
return true
default:
return false
diff --git a/models/project/project_test.go b/models/project/project_test.go
index 6caa244f54..71ceda7aa5 100644
--- a/models/project/project_test.go
+++ b/models/project/project_test.go
@@ -20,7 +20,7 @@ func TestIsProjectTypeValid(t *testing.T) {
typ Type
valid bool
}{
- {TypeIndividual, false},
+ {TypeIndividual, true},
{TypeRepository, true},
{TypeOrganization, true},
{UnknownType, false},