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 authored and GitHub committed 2021-11-09 08:54:46 +00:00
1 parent 03de593402
commit 3a693bd18c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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},