diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-11-21 01:10:18 +0800 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-11-20 12:10:18 -0500 |
commit | 499bff43d935f1334a76b86fe3a44a5a670479ef (patch) | |
tree | d58f56eec3f0942f96d7f5419e6f9cd5ab6d01c1 /models/issue_assignees.go | |
parent | 3a95e2d0eac9834125c2e738ea5daf238c8fc9f7 (diff) | |
download | gitea-499bff43d935f1334a76b86fe3a44a5a670479ef.tar.gz gitea-499bff43d935f1334a76b86fe3a44a5a670479ef.zip |
dont' send assign webhooks when creating issue (#5365)
Diffstat (limited to 'models/issue_assignees.go')
-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) } |