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 }