Skip to content

Conversation

@jolheiser
Copy link
Member

Resolves #6126

Previously, a page size of -1 would cause a panic when making the slice. users = make([]*User, 0, opts.PageSize)
Now, in the user search API the page size will be checked for <=0 in order to enforce page sizes.
Admins, however, will be able to use the -1 page size to get back all users/orgs

…tAllOrgs)

Non-admins will default to 10 page size
@codecov-io
Copy link

codecov-io commented Feb 21, 2019

Codecov Report

Merging #6143 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6143      +/-   ##
==========================================
- Coverage   38.86%   38.84%   -0.02%     
==========================================
  Files         354      354              
  Lines       50112    50115       +3     
==========================================
- Hits        19474    19468       -6     
- Misses      27820    27829       +9     
  Partials     2818     2818
Impacted Files Coverage Δ
models/user.go 49.72% <0%> (-0.14%) ⬇️
routers/api/v1/user/user.go 23.52% <0%> (ø) ⬆️
models/unit.go 0% <0%> (-14.29%) ⬇️
routers/repo/view.go 44.54% <0%> (-1.15%) ⬇️

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 477ef46...175ab5a. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 21, 2019
@techknowlogick techknowlogick added type/bug modifies/api This PR adds API routes or modifies them labels Feb 21, 2019
@techknowlogick techknowlogick added this to the 1.8.0 milestone Feb 21, 2019
@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 Feb 21, 2019
@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 Feb 21, 2019
@techknowlogick techknowlogick merged commit 994b1be into go-gitea:master Feb 21, 2019
@jolheiser jolheiser deleted the 6126_admin_API branch February 27, 2019 22:15
@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. modifies/api This PR adds API routes or modifies them type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New admin endpoints getAllOrgs and getAllUsers cause internal server error

7 participants