Skip to content

Commit f6b68be

Browse files
committed
rearrange NotFound call
1 parent 7c2cb4b commit f6b68be

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

routers/web/explore/user.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions,
8686
}
8787

8888
if opts.SupportedSortOrders != nil && !opts.SupportedSortOrders.Contains(sortOrder) {
89+
ctx.NotFound("unsupported sort order", nil)
8990
return
9091
}
9192

@@ -150,11 +151,6 @@ func Users(ctx *context.Context) {
150151
ctx.SetFormString("sort", sortOrder)
151152
}
152153

153-
if !supportedSortOrders.Contains(sortOrder) {
154-
ctx.NotFound("unsupported sort order", nil)
155-
return
156-
}
157-
158154
RenderUserSearch(ctx, &user_model.SearchUserOptions{
159155
Actor: ctx.Doer,
160156
Type: user_model.UserTypeIndividual,

0 commit comments

Comments
 (0)