Skip to content

Commit eb0f166

Browse files
thehowllunny
authored andcommitted
Address issues pointed out by @lunny in #3339 (#3352)
1 parent 51a18f7 commit eb0f166

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

routers/org/org.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ const (
2222

2323
// Create render the page for create organization
2424
func Create(ctx *context.Context) {
25-
if !ctx.User.CanCreateOrganization() {
26-
ctx.NotFound("CanCreateOrganization", nil)
27-
}
28-
2925
ctx.Data["Title"] = ctx.Tr("new_org")
3026
if !ctx.User.CanCreateOrganization() {
3127
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
@@ -36,12 +32,13 @@ func Create(ctx *context.Context) {
3632

3733
// CreatePost response for create organization
3834
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
35+
ctx.Data["Title"] = ctx.Tr("new_org")
36+
3937
if !ctx.User.CanCreateOrganization() {
40-
ctx.NotFound("CanCreateOrganization", nil)
38+
ctx.ServerError("Not allowed", errors.New(ctx.Tr("org.form.create_org_not_allowed")))
39+
return
4140
}
4241

43-
ctx.Data["Title"] = ctx.Tr("new_org")
44-
4542
if ctx.HasError() {
4643
ctx.HTML(200, tplCreateOrg)
4744
return

0 commit comments

Comments
 (0)