File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,6 @@ const (
22
22
23
23
// Create render the page for create organization
24
24
func Create (ctx * context.Context ) {
25
- if ! ctx .User .CanCreateOrganization () {
26
- ctx .NotFound ("CanCreateOrganization" , nil )
27
- }
28
-
29
25
ctx .Data ["Title" ] = ctx .Tr ("new_org" )
30
26
if ! ctx .User .CanCreateOrganization () {
31
27
ctx .ServerError ("Not allowed" , errors .New (ctx .Tr ("org.form.create_org_not_allowed" )))
@@ -36,12 +32,13 @@ func Create(ctx *context.Context) {
36
32
37
33
// CreatePost response for create organization
38
34
func CreatePost (ctx * context.Context , form auth.CreateOrgForm ) {
35
+ ctx .Data ["Title" ] = ctx .Tr ("new_org" )
36
+
39
37
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
41
40
}
42
41
43
- ctx .Data ["Title" ] = ctx .Tr ("new_org" )
44
-
45
42
if ctx .HasError () {
46
43
ctx .HTML (200 , tplCreateOrg )
47
44
return
You can’t perform that action at this time.
0 commit comments