Skip to content

Commit

Permalink
base_tier_validation: only post notifications to reciepients
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd authored and celm1990 committed Jan 9, 2024
1 parent 3c26247 commit bb5723c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,14 @@ def _notify_review_requested(self, tier_reviews):
lambda r: r.definition_id.notify_on_create and r.res_id == rec.id # noqa: B023
).mapped("reviewer_ids")
# Subscribe reviewers and notify
getattr(rec, subscribe)(
partner_ids=users_to_notify.mapped("partner_id").ids
)
getattr(rec, post)(
subtype_xmlid=self._get_requested_notification_subtype(),
body=rec._notify_requested_review_body(),
)
if len(users_to_notify) > 0:
getattr(rec, subscribe)(
partner_ids=users_to_notify.mapped("partner_id").ids
)
getattr(rec, post)(
subtype_xmlid=self._get_requested_notification_subtype(),
body=rec._notify_requested_review_body(),
)

def _prepare_tier_review_vals(self, definition, sequence):
return {
Expand Down

0 comments on commit bb5723c

Please sign in to comment.