diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-11-21 23:12:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-21 23:12:17 +0800 |
commit | 5d69703d3c2719b1257b13f72ce5264d2b2f1823 (patch) | |
tree | a72b0cb403c83a4b9f8b29eb17a00bf02b44ee4b /models | |
parent | ffc0c7f611a957e3848d810578579bc3566e311c (diff) | |
download | gitea-5d69703d3c2719b1257b13f72ce5264d2b2f1823.tar.gz gitea-5d69703d3c2719b1257b13f72ce5264d2b2f1823.zip |
dont' send assign webhooks when creating issue (#5365) (#5369)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_assignees.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go index b4f346974b..09d4d310dc 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -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) } |