mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible * speedup goGet * only convert if nessesary
This commit is contained in:
parent
2d25b7d44b
commit
f1a810e090
22 changed files with 36 additions and 52 deletions
|
@ -7,7 +7,6 @@ package explore
|
|||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
|
@ -63,7 +62,7 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN
|
|||
orderBy = models.SearchOrderByAlphabetically
|
||||
}
|
||||
|
||||
opts.Keyword = strings.Trim(ctx.FormString("q"), " ")
|
||||
opts.Keyword = ctx.FormTrim("q")
|
||||
opts.OrderBy = orderBy
|
||||
if len(opts.Keyword) == 0 || isKeywordValid(opts.Keyword) {
|
||||
users, count, err = models.SearchUsers(opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue