summaryrefslogtreecommitdiffstats
path: root/services/mailer
diff options
context:
space:
mode:
authorsebastian-sauer <sauer.sebastian@gmail.com>2023-09-13 21:48:36 +0200
committerGitHub <noreply@github.com>2023-09-13 19:48:36 +0000
commite116ad4500bbaac140d53a6a699d4609fa066fa7 (patch)
tree33d3922c1317df6c8d8fe10fe2c4a022a8f0fef2 /services/mailer
parent5d755ac6aef13e396341d5ce20238e86b8e08277 (diff)
downloadgitea-e116ad4500bbaac140d53a6a699d4609fa066fa7.tar.gz
gitea-e116ad4500bbaac140d53a6a699d4609fa066fa7.zip
Load reviewer before sending notification (#27063)
The [template](https://github.com/go-gitea/gitea/blob/main/templates/mail/issue/default.tmpl#L51) uses the Reviewer.Name property - this was not loaded. Fixes #27035
Diffstat (limited to 'services/mailer')
-rw-r--r--services/mailer/notify.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/mailer/notify.go b/services/mailer/notify.go
index f0419e2cbb..9eaf268d0a 100644
--- a/services/mailer/notify.go
+++ b/services/mailer/notify.go
@@ -176,6 +176,9 @@ func (m *mailNotifier) PullRequestPushCommits(ctx context.Context, doer *user_mo
}
func (m *mailNotifier) PullReviewDismiss(ctx context.Context, doer *user_model.User, review *issues_model.Review, comment *issues_model.Comment) {
+ if err := comment.Review.LoadReviewer(ctx); err != nil {
+ log.Error("Error in PullReviewDismiss while loading reviewer for issue[%d], review[%d] and reviewer[%d]: %v", review.Issue.ID, comment.Review.ID, comment.Review.ReviewerID, err)
+ }
if err := MailParticipantsComment(ctx, comment, activities_model.ActionPullReviewDismissed, review.Issue, nil); err != nil {
log.Error("MailParticipantsComment: %v", err)
}