Skip to content

Commit b88dbe1

Browse files
authored
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.
1 parent 697213b commit b88dbe1

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

models/user.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,14 +1619,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
16191619
}
16201620

16211621
if opts.Actor != nil {
1622-
var exprCond builder.Cond
1623-
if setting.Database.UseMySQL {
1624-
exprCond = builder.Expr("org_user.org_id = user.id")
1625-
} else if setting.Database.UseMSSQL {
1626-
exprCond = builder.Expr("org_user.org_id = [user].id")
1627-
} else {
1628-
exprCond = builder.Expr("org_user.org_id = \"user\".id")
1629-
}
1622+
var exprCond builder.Cond = builder.Expr("org_user.org_id = `user`.id")
16301623

16311624
// If Admin - they see all users!
16321625
if !opts.Actor.IsAdmin {

0 commit comments

Comments
 (0)