Skip to content

Commit

Permalink
Removed unused method. (go-gitea#18129)
Browse files Browse the repository at this point in the history
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
2 people authored and Stelios Malathouras committed Mar 28, 2022
1 parent 72bfd98 commit 5ec876c
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions routers/web/repo/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "/")
}

0 comments on commit 5ec876c

Please sign in to comment.