Skip to content

Commit 7a42e35

Browse files
author
Gusted
authored
Pass correct context (#18638)
- Pass the correct context into `db.GetEngine()`. - Introduced in: #18604
1 parent ce8eb20 commit 7a42e35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ func GetUserNamesByIDs(ids []int64) ([]string, error) {
10281028
// GetUserNameByID returns username for the id
10291029
func GetUserNameByID(ctx context.Context, id int64) (string, error) {
10301030
var name string
1031-
has, err := db.GetEngine(db.DefaultContext).Table("user").Where("id = ?", id).Cols("name").Get(&name)
1031+
has, err := db.GetEngine(ctx).Table("user").Where("id = ?", id).Cols("name").Get(&name)
10321032
if err != nil {
10331033
return "", err
10341034
}

0 commit comments

Comments
 (0)