summaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-16 00:36:39 +0800
committerUnknwon <u@gogs.io>2016-07-16 00:36:39 +0800
commitf1b8d52eb3ac230ed5a275f4a844ddb0cf48041e (patch)
tree51dda05a9fb7a985a4e91f3e1708ffddf3fee19c /models/pull.go
parent7ca5f8f119593023809e6130db75154597c52426 (diff)
downloadgitea-f1b8d52eb3ac230ed5a275f4a844ddb0cf48041e.tar.gz
gitea-f1b8d52eb3ac230ed5a275f4a844ddb0cf48041e.zip
#2854 fix no mail notification when issue is closed/reopened
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/models/pull.go b/models/pull.go
index 8ef0cc643a..6380bbbd2d 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -342,9 +342,6 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str
RepoName: repo.Name,
IsPrivate: repo.IsPrivate,
}
- if err = notifyWatchers(sess, act); err != nil {
- return err
- }
pr.Index = pull.Index
if err = repo.SavePatch(pr.Index, patch); err != nil {
@@ -364,7 +361,17 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str
return fmt.Errorf("insert pull repo: %v", err)
}
- return sess.Commit()
+ if err = sess.Commit(); err != nil {
+ return fmt.Errorf("Commit: %v", err)
+ }
+
+ if err = NotifyWatchers(act); err != nil {
+ log.Error(4, "NotifyWatchers: %v", err)
+ } else if err = pull.MailParticipants(); err != nil {
+ log.Error(4, "MailParticipants: %v", err)
+ }
+
+ return nil
}
// GetUnmergedPullRequest returnss a pull request that is open and has not been merged