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

Fix creation of Organization repos by Users with max created personal repos #11183

Merged
merged 6 commits into from
Apr 30, 2020

Conversation

AndrewBezold
Copy link
Contributor

Creation of Organization repositories by Users with the maximum number of personal repositories is currently broken. Instead of crashing or giving an error message, don't display Organizations with the maximum number of repositories in the dropdown.

This will not change the initial selection in the dropdown as that is generated from the context. This will also not remove the user from the list if their number of repositories is at or beyond the maximum. It will also not affect Administrators, though that is intended.

Fix #9269

@codecov-io
Copy link

codecov-io commented Apr 23, 2020

Codecov Report

Merging #11183 into master will decrease coverage by 0.13%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11183      +/-   ##
==========================================
- Coverage   43.34%   43.20%   -0.14%     
==========================================
  Files         601      604       +3     
  Lines       85675    86058     +383     
==========================================
+ Hits        37133    37181      +48     
- Misses      43956    44287     +331     
- Partials     4586     4590       +4     
Impacted Files Coverage Δ
models/user.go 49.66% <ø> (ø)
routers/repo/repo.go 32.17% <64.28%> (+0.57%) ⬆️
modules/markup/markdown/goldmark.go 36.96% <0.00%> (-28.00%) ⬇️
modules/indexer/stats/queue.go 62.50% <0.00%> (-18.75%) ⬇️
modules/indexer/stats/db.go 40.62% <0.00%> (-9.38%) ⬇️
routers/user/notification.go 39.70% <0.00%> (-5.46%) ⬇️
modules/git/utils.go 65.67% <0.00%> (-4.48%) ⬇️
modules/markup/html.go 77.38% <0.00%> (-2.22%) ⬇️
modules/git/repo.go 47.28% <0.00%> (-0.84%) ⬇️
modules/setting/setting.go 45.28% <0.00%> (ø)
... and 11 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 e74c4e1...a0b44d5. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 23, 2020
@guillep2k guillep2k added this to the 1.12.0 milestone Apr 24, 2020
templates/repo/create.tmpl Outdated Show resolved Hide resolved
routers/repo/repo.go Show resolved Hide resolved
Add a note for user.CanCreateRepo() about failure assumptions
Change repo.create help message
@GiteaBot GiteaBot 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 Apr 26, 2020
Copy link
Member

@gary-kim gary-kim left a comment

Choose a reason for hiding this comment

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

LGTM

@GiteaBot GiteaBot 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 Apr 26, 2020
@zeripath
Copy link
Contributor

make lg-tm work

@zeripath zeripath merged commit 3dc6af3 into go-gitea:master Apr 30, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
… repos (go-gitea#11183)

* Fix creation of Org repos

Fix go-gitea#9269

* Change variable name to appease linter

* Update PR with suggestions

Add a note for user.CanCreateRepo() about failure assumptions
Change repo.create help message

Co-authored-by: guillep2k <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reached MAX_CREATION_LIMIT forbids user from creating a repo within an org
6 participants