mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Removed unused method. (#18129)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -653,39 +653,3 @@ func CreateProject(ctx *context.Context) {
 | 
			
		||||
 | 
			
		||||
	ctx.HTML(http.StatusOK, tplGenericProjectsNew)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CreateProjectPost creates an individual and/or organization project
 | 
			
		||||
func CreateProjectPost(ctx *context.Context, form forms.UserCreateProjectForm) {
 | 
			
		||||
 | 
			
		||||
	user := checkContextUser(ctx, form.UID)
 | 
			
		||||
	if ctx.Written() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ctx.Data["ContextUser"] = user
 | 
			
		||||
 | 
			
		||||
	if ctx.HasError() {
 | 
			
		||||
		ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects)
 | 
			
		||||
		ctx.HTML(http.StatusOK, tplGenericProjectsNew)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var projectType = models.ProjectTypeIndividual
 | 
			
		||||
	if user.IsOrganization() {
 | 
			
		||||
		projectType = models.ProjectTypeOrganization
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := models.NewProject(&models.Project{
 | 
			
		||||
		Title:       form.Title,
 | 
			
		||||
		Description: form.Content,
 | 
			
		||||
		CreatorID:   user.ID,
 | 
			
		||||
		BoardType:   form.BoardType,
 | 
			
		||||
		Type:        projectType,
 | 
			
		||||
	}); err != nil {
 | 
			
		||||
		ctx.ServerError("NewProject", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ctx.Flash.Success(ctx.Tr("repo.projects.create_success", form.Title))
 | 
			
		||||
	ctx.Redirect(setting.AppSubURL + "/")
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user