1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 13:37:20 +00:00

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>
This commit is contained in:
wxiaoguang
2024-04-15 01:22:14 +08:00
committed by GitHub
parent e20428d8f6
commit 4c6e2da088
4 changed files with 31 additions and 30 deletions

View File

@ -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