Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused method CreateProjectPost #18129

Merged
merged 2 commits into from
Dec 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 + "/")
}