diff options
author | Morgan Bazalgette <git@howl.moe> | 2018-01-12 15:37:30 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-01-12 08:37:30 -0600 |
commit | eb0f166f507c014aa808ac9f5576689e6bf66916 (patch) | |
tree | b394a4b06c25bcb9b37b84f3c9ce6a17790bade2 /routers/org/org.go | |
parent | 51a18f7e54e62e1510b2878edf20b5dd138a3e94 (diff) | |
download | gitea-eb0f166f507c014aa808ac9f5576689e6bf66916.tar.gz gitea-eb0f166f507c014aa808ac9f5576689e6bf66916.zip |
Address issues pointed out by @lunny in #3339 (#3352)
Diffstat (limited to 'routers/org/org.go')
-rw-r--r-- | routers/org/org.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/routers/org/org.go b/routers/org/org.go index 665d1a71fc..bb7540277c 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -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 |