aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-04-15 01:49:16 +0800
committerGitHub <noreply@github.com>2024-04-14 17:49:16 +0000
commitb266c78cff607ad5f3c8a6c03e5a5801cb9ed0ff (patch)
treeb053c1b8ce25de3cfecdec253a41fbad0eb406d5 /models
parente64926c5193e9ccc30b34f187d96c74d104179ae (diff)
downloadgitea-b266c78cff607ad5f3c8a6c03e5a5801cb9ed0ff.tar.gz
gitea-b266c78cff607ad5f3c8a6c03e5a5801cb9ed0ff.zip
Improve "must-change-password" logic and document (#30472) (#30478)
Backport #30472 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'models')
-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 2a2743e927..6b0ad7744b 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