mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-24 18:10:52 +00:00
Restore form inputs on organization create error (#34201)
Keeps the entered inputs when the "organization create" request returns an error. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 18a673bad1d036502baca4491a16679692c42320)
This commit is contained in:
parent
603d655ec4
commit
64555d6efb
2 changed files with 8 additions and 5 deletions
|
@ -27,11 +27,14 @@ const (
|
|||
// Create render the page for create organization
|
||||
func Create(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("new_org.title")
|
||||
ctx.Data["DefaultOrgVisibilityMode"] = setting.Service.DefaultOrgVisibilityMode
|
||||
if !ctx.Doer.CanCreateOrganization() {
|
||||
ctx.ServerError("Not allowed", errors.New(ctx.Locale.TrString("org.form.create_org_not_allowed")))
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["visibility"] = setting.Service.DefaultOrgVisibilityMode
|
||||
ctx.Data["repo_admin_change_team_access"] = true
|
||||
|
||||
ctx.HTML(http.StatusOK, tplCreateOrg)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue