Browse Source

Address issues pointed out by @lunny in #3339 (#3352)

for-closed-social
Morgan Bazalgette 6 years ago
committed by Lunny Xiao
parent
commit
eb0f166f50
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      routers/org/org.go

+ 4
- 7
routers/org/org.go View File

@ -22,10 +22,6 @@ const (
// Create render the page for create organization
func Create(ctx *context.Context) {
if !ctx.User.CanCreateOrganization() {
ctx.NotFound("CanCreateOrganization", nil)
}
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")))
@ -36,12 +32,13 @@ func Create(ctx *context.Context) {
// CreatePost response for create organization
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
ctx.Data["Title"] = ctx.Tr("new_org")
if !ctx.User.CanCreateOrganization() {
ctx.NotFound("CanCreateOrganization", nil)
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
return
}
ctx.Data["Title"] = ctx.Tr("new_org")
if ctx.HasError() {
ctx.HTML(200, tplCreateOrg)
return

Loading…
Cancel
Save