Skip to content

Commit

Permalink
[FIX] base_tier_validation: last comment instead of first comment
Browse files Browse the repository at this point in the history
- With multiple approbation, the first comment is repeated into
mail.message and propagate wrong message
  • Loading branch information
mathben committed Dec 2, 2024
1 parent 0fe637e commit e28b026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def _notify_accepted_reviews_body(self):
lambda r: (self.env.user in r.reviewer_ids) and r.comment
)
if has_comment:
comment = has_comment.mapped("comment")[0]
comment = has_comment.mapped("comment")[-1]
return _("A review was accepted. (%s)") % comment
return _("A review was accepted")

Expand Down Expand Up @@ -625,7 +625,7 @@ def _notify_rejected_review_body(self):
lambda r: (self.env.user in r.reviewer_ids) and r.comment
)
if has_comment:
comment = has_comment.mapped("comment")[0]
comment = has_comment.mapped("comment")[-1]
return _("A review was rejected by %(user)s. (%(comment)s)") % {
"user": self.env.user.name,
"comment": comment,
Expand Down

0 comments on commit e28b026

Please sign in to comment.