Skip to content

Commit

Permalink
fix duplicated webhook when creating issue with assignees (go-gitea#7681
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lunny committed Jul 31, 2019
1 parent 99ffd82 commit 5bef460
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 5bef460

Please sign in to comment.