summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-27 20:23:37 +0800
committerGitHub <noreply@github.com>2024-04-27 12:23:37 +0000
commitd3cdef88ad4784c19afcf24fbf62fccb03f456ba (patch)
tree18e3a95c19b898202515227352e05b5ea2675c5b /modules
parentdd301cae1c40c9ef2805bd13af6b09a81ff4f5d7 (diff)
downloadgitea-d3cdef88ad4784c19afcf24fbf62fccb03f456ba.tar.gz
gitea-d3cdef88ad4784c19afcf24fbf62fccb03f456ba.zip
Add some tests to clarify the "must-change-password" behavior (#30693)
Follow #30472: When a user is created by command line `./gitea admin user create`: Old behavior before #30472: the first user (admin or non-admin) doesn't need to change password. Revert to the old behavior before #30472
Diffstat (limited to 'modules')
-rw-r--r--modules/log/logger_global.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/log/logger_global.go b/modules/log/logger_global.go
index 994acfedbb..6ce8b70fed 100644
--- a/modules/log/logger_global.go
+++ b/modules/log/logger_global.go
@@ -57,11 +57,13 @@ func Critical(format string, v ...any) {
Log(1, ERROR, format, v...)
}
+var OsExiter = os.Exit
+
// Fatal records fatal log and exit process
func Fatal(format string, v ...any) {
Log(1, FATAL, format, v...)
GetManager().Close()
- os.Exit(1)
+ OsExiter(1)
}
func GetLogger(name string) Logger {