diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-24 17:49:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 17:49:20 +0800 |
commit | a666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch) | |
tree | 9ab1434b759a8a2cb275a83149903a823851e309 /models/issue_list.go | |
parent | 4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff) | |
download | gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip |
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
Diffstat (limited to 'models/issue_list.go')
-rw-r--r-- | models/issue_list.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/issue_list.go b/models/issue_list.go index 6eeb2a961a..7c98f60b3a 100644 --- a/models/issue_list.go +++ b/models/issue_list.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" + user_model "code.gitea.io/gitea/models/user" "xorm.io/builder" ) @@ -84,7 +85,7 @@ func (issues IssueList) loadPosters(e db.Engine) error { } posterIDs := issues.getPosterIDs() - posterMaps := make(map[int64]*User, len(posterIDs)) + posterMaps := make(map[int64]*user_model.User, len(posterIDs)) left := len(posterIDs) for left > 0 { limit := defaultMaxInSize @@ -107,7 +108,7 @@ func (issues IssueList) loadPosters(e db.Engine) error { } var ok bool if issue.Poster, ok = posterMaps[issue.PosterID]; !ok { - issue.Poster = NewGhostUser() + issue.Poster = user_model.NewGhostUser() } } return nil @@ -219,11 +220,11 @@ func (issues IssueList) loadAssignees(e db.Engine) error { } type AssigneeIssue struct { - IssueAssignee *IssueAssignees `xorm:"extends"` - Assignee *User `xorm:"extends"` + IssueAssignee *IssueAssignees `xorm:"extends"` + Assignee *user_model.User `xorm:"extends"` } - assignees := make(map[int64][]*User, len(issues)) + assignees := make(map[int64][]*user_model.User, len(issues)) issueIDs := issues.getIssueIDs() left := len(issueIDs) for left > 0 { |