Skip to content

Commit

Permalink
Use a common quote to instead of check database type (#16817)
Browse files Browse the repository at this point in the history
`` ` `` will be converted to different database quote by xorm. So check database type is unnecessary.
  • Loading branch information
lunny authored Aug 25, 2021
1 parent 697213b commit b88dbe1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b88dbe1

Please sign in to comment.