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:
parent
697213bdb3
commit
b88dbe1208
1 changed files with 1 additions and 8 deletions
|
@ -1619,14 +1619,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Actor != nil {
|
if opts.Actor != nil {
|
||||||
var exprCond builder.Cond
|
var exprCond builder.Cond = builder.Expr("org_user.org_id = `user`.id")
|
||||||
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")
|
|
||||||
}
|
|
||||||
|
|
||||||
// If Admin - they see all users!
|
// If Admin - they see all users!
|
||||||
if !opts.Actor.IsAdmin {
|
if !opts.Actor.IsAdmin {
|
||||||
|
|
Loading…
Reference in a new issue