summaryrefslogtreecommitdiffstats
path: root/models/activities
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-10-03 12:30:41 +0200
committerGitHub <noreply@github.com>2023-10-03 12:30:41 +0200
commitcc5df266808361c1dd3a1d17cbba712826a93d7e (patch)
treef77c59a61d3dc36f07b5b84596e4a1cde12b55cc /models/activities
parentDon't use subselect in `DeleteIssuesByRepoID` (#27332) (diff)
downloadforgejo-cc5df266808361c1dd3a1d17cbba712826a93d7e.tar.xz
forgejo-cc5df266808361c1dd3a1d17cbba712826a93d7e.zip
Even more `db.DefaultContext` refactor (#27352)
Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'models/activities')
-rw-r--r--models/activities/action.go2
-rw-r--r--models/activities/statistic.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/activities/action.go b/models/activities/action.go
index 67828f65a1..9b62a4631a 100644
--- a/models/activities/action.go
+++ b/models/activities/action.go
@@ -524,7 +524,7 @@ func activityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.
}
if opts.RequestedTeam != nil {
- env := organization.OrgFromUser(opts.RequestedUser).AccessibleTeamReposEnv(opts.RequestedTeam)
+ env := organization.OrgFromUser(opts.RequestedUser).AccessibleTeamReposEnv(ctx, opts.RequestedTeam)
teamRepoIDs, err := env.RepoIDs(1, opts.RequestedUser.NumRepos)
if err != nil {
return nil, fmt.Errorf("GetTeamRepositories: %w", err)
diff --git a/models/activities/statistic.go b/models/activities/statistic.go
index 5479db20eb..ea13f3ed5c 100644
--- a/models/activities/statistic.go
+++ b/models/activities/statistic.go
@@ -52,7 +52,7 @@ type IssueByRepositoryCount struct {
func GetStatistic(ctx context.Context) (stats Statistic) {
e := db.GetEngine(ctx)
stats.Counter.User = user_model.CountUsers(ctx, nil)
- stats.Counter.Org, _ = organization.CountOrgs(organization.FindOrgOptions{IncludePrivate: true})
+ stats.Counter.Org, _ = organization.CountOrgs(ctx, organization.FindOrgOptions{IncludePrivate: true})
stats.Counter.PublicKey, _ = e.Count(new(asymkey_model.PublicKey))
stats.Counter.Repo, _ = repo_model.CountRepositories(ctx, repo_model.CountRepositoryOptions{})
stats.Counter.Watch, _ = e.Count(new(repo_model.Watch))