aboutsummaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-15 01:22:14 +0800
committerGitHub <noreply@github.com>2024-04-14 17:22:14 +0000
commit4c6e2da088cf092a9790df5c84b7b338508fede7 (patch)
tree7552e449d209d2daf24bbd4905abaa6ed9e7e6ed /models/db
parente20428d8f64697d7c6418b42d0a8e57d1d3f588c (diff)
downloadgitea-4c6e2da088cf092a9790df5c84b7b338508fede7.tar.gz
gitea-4c6e2da088cf092a9790df5c84b7b338508fede7.zip
Improve "must-change-password" logic and document (#30472)
Unify the behaviors of "user create" and "user change-password". Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'models/db')
-rwxr-xr-xmodels/db/engine.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/db/engine.go b/models/db/engine.go
index 8684c4e2f1..26abf0b96c 100755
--- a/models/db/engine.go
+++ b/models/db/engine.go
@@ -284,8 +284,8 @@ func MaxBatchInsertSize(bean any) int {
}
// IsTableNotEmpty returns true if table has at least one record
-func IsTableNotEmpty(tableName string) (bool, error) {
- return x.Table(tableName).Exist()
+func IsTableNotEmpty(beanOrTableName any) (bool, error) {
+ return x.Table(beanOrTableName).Exist()
}
// DeleteAllRecords will delete all the records of this table