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 committed Nov 21, 2023
1 parent 2f512ff commit 127ec31
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 @@ -447,13 +447,14 @@ def _notify_review_requested(self, tier_reviews):
lambda r: r.definition_id.notify_on_create and r.res_id == rec.id
).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)(

Check warning on line 451 in base_tier_validation/models/tier_validation.py

View check run for this annotation

Codecov / codecov/patch

base_tier_validation/models/tier_validation.py#L451

Added line #L451 was not covered by tests
partner_ids=users_to_notify.mapped("partner_id").ids
)
getattr(rec, post)(

Check warning on line 454 in base_tier_validation/models/tier_validation.py

View check run for this annotation

Codecov / codecov/patch

base_tier_validation/models/tier_validation.py#L454

Added line #L454 was not covered by tests
subtype_xmlid=self._get_requested_notification_subtype(),
body=rec._notify_requested_review_body(),
)

def request_validation(self):
td_obj = self.env["tier.definition"]
Expand Down

0 comments on commit 127ec31

Please sign in to comment.