Skip to content

Commit

Permalink
Fix error message if user not exist (#16343)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Dryabzhinsky <sergey@rusoft.ru>
  • Loading branch information
6543 and sergey-dryabzhinsky authored Jul 5, 2021
1 parent c65e49d commit 7ff8e86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/user/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func GetUserByParamsName(ctx *context.APIContext, name string) *models.User {
user, err := models.GetUserByName(username)
if err != nil {
if models.IsErrUserNotExist(err) {
if redirectUserID, err := models.LookupUserRedirect(username); err == nil {
if redirectUserID, err2 := models.LookupUserRedirect(username); err2 == nil {
context.RedirectToUser(ctx.Context, username, redirectUserID)
} else {
ctx.NotFound("GetUserByName", err)
Expand Down

0 comments on commit 7ff8e86

Please sign in to comment.