diff options
author | Gusted <postmaster@gusted.xyz> | 2023-01-30 11:12:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 18:12:45 +0800 |
commit | 1b53a9e91401c931065949981d02e06bbcd745ef (patch) | |
tree | c2d6a68a72e3ae892da47928eac9855f01673e5a /templates/repo/header.tmpl | |
parent | be315c76fba151bae3f02f18ba0213c8b1c4327f (diff) | |
download | gitea-1b53a9e91401c931065949981d02e06bbcd745ef.tar.gz gitea-1b53a9e91401c931065949981d02e06bbcd745ef.zip |
Don't return duplicated users who can create org repo (#22560)
- Currently the function `GetUsersWhoCanCreateOrgRepo` uses a query that
is able to have duplicated users in the result, this is can happen under
the condition that a user is in team that either is the owner team or
has permission to create organization repositories.
- Add test code to simulate the above condition for user 3,
[`TestGetUsersWhoCanCreateOrgRepo`](https://github.com/go-gitea/gitea/blob/a1fcb1cfb84fd6b36c8fe9fd56588119fa4377bc/models/organization/org_test.go#L435)
is the test function that tests for this.
- The fix is quite trivial use a map keyed by user id in order to drop
duplicates.
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/repo/header.tmpl')
0 files changed, 0 insertions, 0 deletions