aboutsummaryrefslogtreecommitdiffstats
path: root/models/user
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-01-13 20:32:28 +0000
committerGitHub <noreply@github.com>2022-01-13 21:32:28 +0100
commitd413a1f8a4bfe4a1d32221346a274cffbb5122ad (patch)
tree8f653cb6612cbc22b49a775f481224b7d3d19d97 /models/user
parent696521b33bb3323b90f18d26e46b5124c5ee3426 (diff)
downloadgitea-d413a1f8a4bfe4a1d32221346a274cffbb5122ad.tar.gz
gitea-d413a1f8a4bfe4a1d32221346a274cffbb5122ad.zip
Improve the comment for 2FA filter in admin panel (#18017)
Replace TODO with explanation Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/user')
-rw-r--r--models/user/search.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/user/search.go b/models/user/search.go
index 5c37bb9961..fac180529f 100644
--- a/models/user/search.go
+++ b/models/user/search.go
@@ -107,7 +107,9 @@ func (opts *SearchUserOptions) toSearchQueryBase() *xorm.Session {
}
// 2fa filter uses LEFT JOIN to check whether a user has a 2fa record
- // TODO: bad performance here, maybe there will be a column "is_2fa_enabled" in the future
+ // While using LEFT JOIN, sometimes the performance might not be good, but it won't be a problem now, such SQL is seldom executed.
+ // There are some possible methods to refactor this SQL in future when we really need to optimize the performance (but not now):
+ // (1) add a column in user table (2) add a setting value in user_setting table (3) use search engines (bleve/elasticsearch)
if opts.IsTwoFactorEnabled.IsTrue() {
cond = cond.And(builder.Expr("two_factor.uid IS NOT NULL"))
} else {