Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't return duplicated users who can create org repo (#go-gitea#22560)
- Backport of go-gitea#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, which is adding `DISTINCT` keyword to `` `user`.id ``.
- Loading branch information