Move user related model into models/user (#17781)

* Move user related model into models/user

* Fix lint for windows

* Fix windows lint

* Fix windows lint

* Move some tests in models

* Merge
This commit is contained in:
Lunny Xiao 2021-11-24 17:49:20 +08:00 committed by GitHub
parent 4e7ca946da
commit a666829a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
345 changed files with 4230 additions and 3813 deletions

View file

@ -7,7 +7,7 @@ package cron
import (
"time"
"code.gitea.io/gitea/models"
user_model "code.gitea.io/gitea/models/user"
"github.com/unknwon/i18n"
)
@ -17,7 +17,7 @@ type Config interface {
IsEnabled() bool
DoRunAtStart() bool
GetSchedule() string
FormatMessage(name, status string, doer *models.User, args ...interface{}) string
FormatMessage(name, status string, doer *user_model.User, args ...interface{}) string
DoNoticeOnSuccess() bool
}
@ -70,7 +70,7 @@ func (b *BaseConfig) DoNoticeOnSuccess() bool {
}
// FormatMessage returns a message for the task
func (b *BaseConfig) FormatMessage(name, status string, doer *models.User, args ...interface{}) string {
func (b *BaseConfig) FormatMessage(name, status string, doer *user_model.User, args ...interface{}) string {
realArgs := make([]interface{}, 0, len(args)+2)
realArgs = append(realArgs, i18n.Tr("en-US", "admin.dashboard."+name))
if doer == nil {