From 9413a5a09a04c677ff4a203451841e2aec5226c4 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 6 Feb 2022 13:05:07 +0100 Subject: [PATCH] Pass correct context (#18638) - Pass the correct context into `db.GetEngine()`. - Introduced in: https://github.com/go-gitea/gitea/pull/18604 --- models/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user/user.go b/models/user/user.go index 5ed850bdfa83d..bd55249448a2c 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 }