Browse Source

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.
tags/v1.16.0-rc1
Lunny Xiao 2 years ago
parent
commit
b88dbe1208
No account linked to committer's email address
1 changed files with 1 additions and 8 deletions
  1. 1
    8
      models/user.go

+ 1
- 8
models/user.go 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 {

Loading…
Cancel
Save