]> source.dussan.org Git - gitea.git/commitdiff
Load reviewer before sending notification (#27063)
authorsebastian-sauer <sauer.sebastian@gmail.com>
Wed, 13 Sep 2023 19:48:36 +0000 (21:48 +0200)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2023 19:48:36 +0000 (19:48 +0000)
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

services/mailer/notify.go

index f0419e2cbb4f312848a3efdb198ef1fa9b07947b..9eaf268d0ac896053fa05a69cc841507ad605e8b 100644 (file)
@@ -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)
        }