aboutsummaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-11-09 09:54:46 +0100
committerGitHub <noreply@github.com>2021-11-09 08:54:46 +0000
commit3a693bd18c6274b62aa7bcde69e9a0d86e43c534 (patch)
tree4ad993db8b2853cda70810db07f17bf2b3e22bba /models/org.go
parent03de5934027ee5fcfb517016f27a4471f2bdd846 (diff)
downloadgitea-3a693bd18c6274b62aa7bcde69e9a0d86e43c534.tar.gz
gitea-3a693bd18c6274b62aa7bcde69e9a0d86e43c534.zip
Use provided database Engine (#17595)
- Don't get the engine from `db.DefaultContext`, instead use the provided one which is passed as paramater `e`.
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index 8cba485a89..d2801a30ce 100644
--- a/models/org.go
+++ b/models/org.go
@@ -412,7 +412,7 @@ func GetUsersWhoCanCreateOrgRepo(orgID int64) ([]*User, error) {
func getUsersWhoCanCreateOrgRepo(e db.Engine, orgID int64) ([]*User, error) {
users := make([]*User, 0, 10)
- return users, db.GetEngine(db.DefaultContext).
+ return users, e.
Join("INNER", "`team_user`", "`team_user`.uid=`user`.id").
Join("INNER", "`team`", "`team`.id=`team_user`.team_id").
Where(builder.Eq{"team.can_create_org_repo": true}.Or(builder.Eq{"team.authorize": AccessModeOwner})).