aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-08-25 20:23:34 +0800
committerGitHub <noreply@github.com>2021-08-25 13:23:34 +0100
commitb88dbe1208e970776119d1b3c2807f995306d4b2 (patch)
tree16fb76b29921f491869c9394cf5daa6162866f24
parent697213bdb35a745879145b1c9edc47552a05fe1b (diff)
downloadgitea-b88dbe1208e970776119d1b3c2807f995306d4b2.tar.gz
gitea-b88dbe1208e970776119d1b3c2807f995306d4b2.zip
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.
-rw-r--r--models/user.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/models/user.go b/models/user.go
index 1af9e545ad..a2d185de39 100644
--- a/models/user.go
+++ b/models/user.go
@@ -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 {