Skip to content

Commit

Permalink
fix duplicated webhook when creating issue with assignees (#7681) (#7684
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lunny authored and lafriks committed Jul 31, 2019
1 parent 99ffd82 commit ee43d20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions models/issue_assignees.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
return err
}

return sess.Commit()
if err := sess.Commit(); err != nil {
return err
}

go HookQueue.Add(issue.RepoID)
return nil
}

func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID int64, isCreate bool) (err error) {

// Update the assignee
removed, err := updateIssueAssignee(sess, issue, assigneeID)
if err != nil {
Expand Down Expand Up @@ -209,7 +213,6 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
return nil
}
}
go HookQueue.Add(issue.RepoID)
return nil
}

Expand Down

0 comments on commit ee43d20

Please sign in to comment.