From 8e45fcb63aeedcf89a705227fa7675698d68d43c Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Fri, 17 Mar 2023 22:07:23 +0900 Subject: 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 Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> --- models/project/project.go | 2 +- models/project/project_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models/project') 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}, -- cgit v1.2.3