forked from forgejo/forgejo
migrate some more "OptionalBool" to "Option[bool]" (#29479)
just some refactoring bits towards replacing **util.OptionalBool** with **optional.Option[bool]** --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me> (cherry picked from commit f6656181e4a07d6c415927220efa2077d509f7c6) Conflicts: models/repo/repo_list_test.go trivial shared fixture count conflicts
This commit is contained in:
parent
4127fcd608
commit
d3d70198b0
23 changed files with 183 additions and 174 deletions
|
@ -12,8 +12,8 @@ import (
|
|||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
|
@ -68,10 +68,10 @@ func Emails(ctx *context.Context) {
|
|||
opts.Keyword = ctx.FormTrim("q")
|
||||
opts.SortType = orderBy
|
||||
if len(ctx.FormString("is_activated")) != 0 {
|
||||
opts.IsActivated = util.OptionalBoolOf(ctx.FormBool("activated"))
|
||||
opts.IsActivated = optional.Some(ctx.FormBool("activated"))
|
||||
}
|
||||
if len(ctx.FormString("is_primary")) != 0 {
|
||||
opts.IsPrimary = util.OptionalBoolOf(ctx.FormBool("primary"))
|
||||
opts.IsPrimary = optional.Some(ctx.FormBool("primary"))
|
||||
}
|
||||
|
||||
if len(opts.Keyword) == 0 || isKeywordValid(opts.Keyword) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue