Skip to content
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

Merged
merged 3 commits into from
Jan 10, 2018
Merged

Handle refactor #3339

merged 3 commits into from
Jan 10, 2018

Conversation

thehowl
Copy link
Contributor

@thehowl thehowl commented Jan 9, 2018

As per discussion in #3330

}, func(ctx *context.Context) {
if !ctx.User.CanCreateOrganization() {
ctx.NotFound()
}
Copy link
Contributor Author

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.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 9, 2018
@codecov-io
Copy link

codecov-io commented Jan 9, 2018

Codecov Report

Merging #3339 into master will increase coverage by 0.18%.
The diff coverage is 1.46%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
routers/repo/download.go 57.14% <0%> (ø) ⬆️
routers/org/setting.go 0% <0%> (ø) ⬆️
routers/repo/issue_label.go 45.92% <0%> (ø) ⬆️
routers/user/auth_openid.go 0% <0%> (ø) ⬆️
routers/user/profile.go 32.85% <0%> (ø) ⬆️
routers/api/v1/repo/milestone.go 0% <0%> (ø) ⬆️
routers/repo/issue.go 32.74% <0%> (ø) ⬆️
routers/admin/repos.go 0% <0%> (ø) ⬆️
routers/repo/setting.go 7.34% <0%> (ø) ⬆️
routers/api/v1/repo/repo.go 38.46% <0%> (ø) ⬆️
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45c264f...d93e898. Read the comment docs.

@lafriks lafriks added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jan 9, 2018
@lafriks lafriks added this to the 1.4.0 milestone Jan 9, 2018
@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 10, 2018
@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 10, 2018
Copy link
Member

@sapk sapk left a 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

@lafriks
Copy link
Member

lafriks commented Jan 10, 2018

@thehowl can you please force push? nevermind, I can now restart drone builds :)

@lafriks lafriks merged commit 6586190 into go-gitea:master Jan 10, 2018
@@ -22,16 +22,24 @@ const (

// Create render the page for create organization
func Create(ctx *context.Context) {
if !ctx.User.CanCreateOrganization() {
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return

@lunny
Copy link
Member

lunny commented Jan 11, 2018

@thehowl sorry for late to submit my review.

@thehowl
Copy link
Contributor Author

thehowl commented Jan 11, 2018

@lunny thanks for the review, will address issues later today...

@thehowl thehowl deleted the handle-refactor branch January 11, 2018 17:03
lunny pushed a commit that referenced this pull request Jan 12, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants