Skip to content

Commit

Permalink
rearrange NotFound call
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Feb 26, 2024
1 parent 7c2cb4b commit f6b68be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions routers/web/explore/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions,
}

if opts.SupportedSortOrders != nil && !opts.SupportedSortOrders.Contains(sortOrder) {
ctx.NotFound("unsupported sort order", nil)
return
}

Expand Down Expand Up @@ -150,11 +151,6 @@ func Users(ctx *context.Context) {
ctx.SetFormString("sort", sortOrder)
}

if !supportedSortOrders.Contains(sortOrder) {
ctx.NotFound("unsupported sort order", nil)
return
}

RenderUserSearch(ctx, &user_model.SearchUserOptions{
Actor: ctx.Doer,
Type: user_model.UserTypeIndividual,
Expand Down

0 comments on commit f6b68be

Please sign in to comment.