From 7a0347315995b25bcb2dca4786504fb699b5f004 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 19 Nov 2021 19:41:40 +0800 Subject: Use a standalone struct name for Organization (#17632) * Use a standalone struct name for Organization * recover unnecessary change * make the code readable * Fix template failure * Fix template failure * Move HasMemberWithUserID to org * Fix test * Remove unnecessary user type check * Fix test Co-authored-by: wxiaoguang --- models/action.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/action.go') diff --git a/models/action.go b/models/action.go index 80ac3e16f8..d790cd6678 100644 --- a/models/action.go +++ b/models/action.go @@ -352,7 +352,7 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) { // check readable repositories by doer/actor if opts.Actor == nil || !opts.Actor.IsAdmin { if opts.RequestedUser.IsOrganization() { - env, err := opts.RequestedUser.AccessibleReposEnv(actorID) + env, err := OrgFromUser(opts.RequestedUser).AccessibleReposEnv(actorID) if err != nil { return nil, fmt.Errorf("AccessibleReposEnv: %v", err) } @@ -366,7 +366,7 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) { } if opts.RequestedTeam != nil { - env := opts.RequestedUser.AccessibleTeamReposEnv(opts.RequestedTeam) + env := OrgFromUser(opts.RequestedUser).AccessibleTeamReposEnv(opts.RequestedTeam) teamRepoIDs, err := env.RepoIDs(1, opts.RequestedUser.NumRepos) if err != nil { return nil, fmt.Errorf("GetTeamRepositories: %v", err) -- cgit v1.2.3