Browse Source

提交代码,解决Bug

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/3432/head
zouap 2 years ago
parent
commit
8bad9d982e
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      models/issue.go

+ 9
- 2
models/issue.go View File

@@ -842,13 +842,20 @@ func (issue *Issue) GetLastEventLabel() string {
// GetLastComment return last comment for the current issue.
func (issue *Issue) GetCloseUser() (*User, error) {
var c Comment
exist, err := x.Where("type = ?", CommentTypeClose).
tmp := CommentTypeClose
if issue.IsPull {
tmp = CommentTypeMergePull
}
exist, err := x.Where("type = ?", tmp).
And("issue_id = ?", issue.ID).Desc("id").Get(&c)
if err != nil {
return nil, err
}
if !exist {
return nil, nil
if issue.Poster == nil {
issue.LoadPoster()
}
return issue.Poster, nil
}
err = c.LoadPoster()
if c.Poster != nil {


Loading…
Cancel
Save