mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Another round of db.DefaultContext
refactor (#27103)
Part of #27065 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
@ -48,10 +48,10 @@ func init() {
|
||||
}
|
||||
|
||||
// LookupUserRedirect look up userID if a user has a redirect name
|
||||
func LookupUserRedirect(userName string) (int64, error) {
|
||||
func LookupUserRedirect(ctx context.Context, userName string) (int64, error) {
|
||||
userName = strings.ToLower(userName)
|
||||
redirect := &Redirect{LowerName: userName}
|
||||
if has, err := db.GetEngine(db.DefaultContext).Get(redirect); err != nil {
|
||||
if has, err := db.GetEngine(ctx).Get(redirect); err != nil {
|
||||
return 0, err
|
||||
} else if !has {
|
||||
return 0, ErrUserRedirectNotExist{Name: userName}
|
||||
|
Reference in New Issue
Block a user