1
0
Fork 0
forgejo/models/activities
Gusted 1b53a9e914
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`](a1fcb1cfb8/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>
2023-01-30 18:12:45 +08:00
..
action.go Use complete SHA to create and query commit status (#22244) 2022-12-27 21:12:49 +08:00
action_list.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
action_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
notification.go Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
notification_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_activity.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
statistic.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user_heatmap.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user_heatmap_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00