1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Use a common quote to instead of check database type (#16817)

`` ` `` will be converted to different database quote by xorm. So check database type is unnecessary.
This commit is contained in:
Lunny Xiao 2021-08-25 20:23:34 +08:00 committed by GitHub
parent 697213bdb3
commit b88dbe1208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1619,14 +1619,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
}
if opts.Actor != nil {
var exprCond builder.Cond
if setting.Database.UseMySQL {
exprCond = builder.Expr("org_user.org_id = user.id")
} else if setting.Database.UseMSSQL {
exprCond = builder.Expr("org_user.org_id = [user].id")
} else {
exprCond = builder.Expr("org_user.org_id = \"user\".id")
}
var exprCond builder.Cond = builder.Expr("org_user.org_id = `user`.id")
// If Admin - they see all users!
if !opts.Actor.IsAdmin {