summaryrefslogtreecommitdiffstats
path: root/models/organization
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-09-16 16:39:12 +0200
committerGitHub <noreply@github.com>2023-09-16 16:39:12 +0200
commitf91dbbba98c841f11d99be998ed5dd98122a457c (patch)
tree9c6c935ccf745c5a1716f1330922354809cd39e0 /models/organization
parentUi correction in mobile view nav bar left aligned items. (#27046) (diff)
downloadforgejo-f91dbbba98c841f11d99be998ed5dd98122a457c.tar.xz
forgejo-f91dbbba98c841f11d99be998ed5dd98122a457c.zip
Next round of `db.DefaultContext` refactor (#27089)
Part of #27065
Diffstat (limited to 'models/organization')
-rw-r--r--models/organization/mini_org.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/organization/mini_org.go b/models/organization/mini_org.go
index b1627b5e6c..b1b24624c5 100644
--- a/models/organization/mini_org.go
+++ b/models/organization/mini_org.go
@@ -4,6 +4,7 @@
package organization
import (
+ "context"
"fmt"
"strings"
@@ -19,7 +20,7 @@ import (
type MinimalOrg = Organization
// GetUserOrgsList returns all organizations the given user has access to
-func GetUserOrgsList(user *user_model.User) ([]*MinimalOrg, error) {
+func GetUserOrgsList(ctx context.Context, user *user_model.User) ([]*MinimalOrg, error) {
schema, err := db.TableInfo(new(user_model.User))
if err != nil {
return nil, err
@@ -42,7 +43,7 @@ func GetUserOrgsList(user *user_model.User) ([]*MinimalOrg, error) {
groupByStr := groupByCols.String()
groupByStr = groupByStr[0 : len(groupByStr)-1]
- sess := db.GetEngine(db.DefaultContext)
+ sess := db.GetEngine(ctx)
sess = sess.Select(groupByStr+", count(distinct repo_id) as org_count").
Table("user").
Join("INNER", "team", "`team`.org_id = `user`.id").