summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-19 19:41:40 +0800
committerGitHub <noreply@github.com>2021-11-19 19:41:40 +0800
commit7a0347315995b25bcb2dca4786504fb699b5f004 (patch)
tree803dfd39286216fd0521ad16539ffd9fc5f87fc0 /models/action.go
parenta09b40de8d1dae7107437cfba42cee201fcd6d42 (diff)
downloadgitea-7a0347315995b25bcb2dca4786504fb699b5f004.tar.gz
gitea-7a0347315995b25bcb2dca4786504fb699b5f004.zip
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 <wxiaoguang@gmail.com>
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go4
1 files changed, 2 insertions, 2 deletions
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)