summaryrefslogtreecommitdiffstats
path: root/models/user.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/user.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/user.go')
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 3ce23ef2ed..dbd4f12b8a 100644
--- a/models/user.go
+++ b/models/user.go
@@ -468,7 +468,7 @@ func (u *User) isVisibleToUser(e db.Engine, viewer *User) bool {
}
// Now we need to check if they in some organization together
- count, err := db.GetEngine(db.DefaultContext).Table("team_user").
+ count, err := e.Table("team_user").
Where(
builder.And(
builder.Eq{"uid": viewer.ID},