1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-01 17:38:33 +00:00

Use provided database Engine (#17595)

- Don't get the engine from `db.DefaultContext`, instead use the
provided one which is passed as paramater `e`.
This commit is contained in:
Gusted 2021-11-09 09:54:46 +01:00 committed by GitHub
parent 03de593402
commit 3a693bd18c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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})).