1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

[F3] introduce UserTypeF3

To avoid conflicts should UserTypeRemoteUser be used differently by Gitea
This commit is contained in:
Loïc Dachary 2023-07-20 14:35:58 +02:00
parent 4dd5b8b8bd
commit 6de2701bb3
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2
4 changed files with 27 additions and 9 deletions

View file

@ -39,7 +39,12 @@ type SearchUserOptions struct {
}
func (opts *SearchUserOptions) toSearchQueryBase() *xorm.Session {
var cond builder.Cond = builder.Eq{"type": opts.Type}
var cond builder.Cond
if opts.Type == UserTypeIndividual {
cond = builder.In("type", UserTypeIndividual, UserTypeF3)
} else {
cond = builder.Eq{"type": opts.Type}
}
if len(opts.Keyword) > 0 {
lowerKeyword := strings.ToLower(opts.Keyword)
keywordCond := builder.Or(