diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-02-06 13:05:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 12:05:07 +0000 |
commit | 7a42e3574102fdd54845f7f626a99419bf6f41b9 (patch) | |
tree | cf400ac0aa2e118bc2c686ffa3b03507e44c479e /models/user | |
parent | ce8eb20a00ff54f8d79dfe03796f11f9178d4c9d (diff) | |
download | gitea-7a42e3574102fdd54845f7f626a99419bf6f41b9.tar.gz gitea-7a42e3574102fdd54845f7f626a99419bf6f41b9.zip |
Pass correct context (#18638)
- Pass the correct context into `db.GetEngine()`.
- Introduced in: https://github.com/go-gitea/gitea/pull/18604
Diffstat (limited to 'models/user')
-rw-r--r-- | models/user/user.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user/user.go b/models/user/user.go index 5ed850bdfa..bd55249448 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -1028,7 +1028,7 @@ func GetUserNamesByIDs(ids []int64) ([]string, error) { // GetUserNameByID returns username for the id func GetUserNameByID(ctx context.Context, id int64) (string, error) { var name string - has, err := db.GetEngine(db.DefaultContext).Table("user").Where("id = ?", id).Cols("name").Get(&name) + has, err := db.GetEngine(ctx).Table("user").Where("id = ?", id).Cols("name").Get(&name) if err != nil { return "", err } |