mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 01:40:36 +00:00
parent
51a18f7e54
commit
eb0f166f50
1 changed files with 5 additions and 8 deletions
|
@ -22,10 +22,6 @@ const (
|
||||||
|
|
||||||
// Create render the page for create organization
|
// Create render the page for create organization
|
||||||
func Create(ctx *context.Context) {
|
func Create(ctx *context.Context) {
|
||||||
if !ctx.User.CanCreateOrganization() {
|
|
||||||
ctx.NotFound("CanCreateOrganization", nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Data["Title"] = ctx.Tr("new_org")
|
ctx.Data["Title"] = ctx.Tr("new_org")
|
||||||
if !ctx.User.CanCreateOrganization() {
|
if !ctx.User.CanCreateOrganization() {
|
||||||
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
|
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
|
||||||
|
@ -36,12 +32,13 @@ func Create(ctx *context.Context) {
|
||||||
|
|
||||||
// CreatePost response for create organization
|
// CreatePost response for create organization
|
||||||
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
|
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
|
||||||
if !ctx.User.CanCreateOrganization() {
|
|
||||||
ctx.NotFound("CanCreateOrganization", nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Data["Title"] = ctx.Tr("new_org")
|
ctx.Data["Title"] = ctx.Tr("new_org")
|
||||||
|
|
||||||
|
if !ctx.User.CanCreateOrganization() {
|
||||||
|
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.HasError() {
|
if ctx.HasError() {
|
||||||
ctx.HTML(200, tplCreateOrg)
|
ctx.HTML(200, tplCreateOrg)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue