Skip to content

Commit

Permalink
Pass correct context (go-gitea#18638)
Browse files Browse the repository at this point in the history
- Pass the correct context into `db.GetEngine()`.
- Introduced in: go-gitea#18604
  • Loading branch information
Gusted authored and Stelios Malathouras committed Mar 28, 2022
1 parent ae6fd01 commit 9413a5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9413a5a

Please sign in to comment.