feat: remove namespaces, make projects infinitely nestable #1362

Merged
konrad merged 68 commits from feature/namespaces-be-gone into main 2023-05-24 14:14:03 +00:00
1 changed files with 1 additions and 5 deletions
Showing only changes of commit 18b9ff8512 - Show all commits

View File

@ -592,8 +592,7 @@ func addProjectDetails(s *xorm.Session, projects map[int64]*Project, a web.Auth)
// CheckIsArchived returns an ErrProjectIsArchived if the project or any of its parent projects is archived.
func (p *Project) CheckIsArchived(s *xorm.Session) (err error) {
// When creating a new project, we check if the parent is archived
if p.ID == 0 {
if p.ParentProjectID > 0 {
p := &Project{ID: p.ParentProjectID}
return p.CheckIsArchived(s)
}
@ -603,8 +602,6 @@ func (p *Project) CheckIsArchived(s *xorm.Session) (err error) {
return err
}
// TODO: parent project
if project.IsArchived {
return ErrProjectIsArchived{ProjectID: p.ID}
}
@ -655,7 +652,6 @@ func CreateProject(s *xorm.Session, project *Project, auth web.Auth) (err error)
project.OwnerID = doer.ID
project.Owner = doer
project.ID = 0 // Otherwise only the first time a new project would be created
err = checkProjectBeforeUpdateOrDelete(s, project)
if err != nil {