-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle refactor #3339
Handle refactor #3339
Conversation
}, func(ctx *context.Context) { | ||
if !ctx.User.CanCreateOrganization() { | ||
ctx.NotFound() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before anyone asks why this was removed: ctx.NotFound does not do what you expect it to - it does not return a 404 response. It registers the handlers for 404 responses, and in this case resets them. The logic for returning not found when someone tries to access /org/create has been moved to org.Create and org.CreatePost.
Codecov Report
@@ Coverage Diff @@
## master #3339 +/- ##
==========================================
+ Coverage 34.85% 35.04% +0.18%
==========================================
Files 280 280
Lines 40559 40566 +7
==========================================
+ Hits 14138 14216 +78
+ Misses 24334 24246 -88
- Partials 2087 2104 +17
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI fail seems unrelated
|
@@ -22,16 +22,24 @@ const ( | |||
|
|||
// Create render the page for create organization | |||
func Create(ctx *context.Context) { | |||
if !ctx.User.CanCreateOrganization() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated code. with line 30.
return | ||
} | ||
ctx.HTML(200, tplCreateOrg) | ||
} | ||
|
||
// CreatePost response for create organization | ||
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) { | ||
if !ctx.User.CanCreateOrganization() { | ||
ctx.NotFound("CanCreateOrganization", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return
@thehowl sorry for late to submit my review. |
@lunny thanks for the review, will address issues later today... |
As per discussion in #3330