dont' send assign webhooks when creating issue (#5365) (#5369)

This commit is contained in:
Lunny Xiao 2018-11-21 23:12:17 +08:00 committed by GitHub
parent ffc0c7f611
commit 5d69703d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,12 +159,13 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
return fmt.Errorf("createAssigneeComment: %v", err)
}
// if issue/pull is in the middle of creation - don't call webhook
if isCreate {
return nil
}
mode, _ := accessLevel(sess, doer.ID, issue.Repo)
if issue.IsPull {
// if pull request is in the middle of creation - don't call webhook
if isCreate {
return nil
}
if err = issue.loadPullRequest(sess); err != nil {
return fmt.Errorf("loadPullRequest: %v", err)
}