diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-05-30 02:08:36 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-30 14:08:36 +0800 |
commit | 367ff327edc6d2865e32d6e8c6fbdd216c4ab730 (patch) | |
tree | cf028827eebc71fb63cefc79c8d72b26144addc1 | |
parent | 2525195749a1c343a9e9ff1f2f328acf7678c28a (diff) | |
download | gitea-367ff327edc6d2865e32d6e8c6fbdd216c4ab730.tar.gz gitea-367ff327edc6d2865e32d6e8c6fbdd216c4ab730.zip |
Use ghost users in issues/PRs (#1831)
-rw-r--r-- | models/issue_list.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/models/issue_list.go b/models/issue_list.go index ede7e8433c..c317f1a157 100644 --- a/models/issue_list.go +++ b/models/issue_list.go @@ -69,7 +69,10 @@ func (issues IssueList) loadPosters(e Engine) error { } for _, issue := range issues { - issue.Poster = posterMaps[issue.PosterID] + var ok bool + if issue.Poster, ok = posterMaps[issue.PosterID]; !ok { + issue.Poster = NewGhostUser() + } } return nil } @@ -173,7 +176,10 @@ func (issues IssueList) loadAssignees(e Engine) error { } for _, issue := range issues { - issue.Assignee = assigneeMaps[issue.AssigneeID] + var ok bool + if issue.Assignee, ok = assigneeMaps[issue.AssigneeID]; !ok { + issue.Assignee = NewGhostUser() + } } return nil } |