diff --git a/src/etools/applications/field_monitoring/planning/models.py b/src/etools/applications/field_monitoring/planning/models.py index 45e7494d9..79077052a 100644 --- a/src/etools/applications/field_monitoring/planning/models.py +++ b/src/etools/applications/field_monitoring/planning/models.py @@ -368,11 +368,10 @@ def check_if_rejected(self, old_instance): ) def send_submit_notice(self): + recipients = set(self.country_pmes) + if self.report_reviewer: - recipients = [self.report_reviewer] - else: - # edge case: if visit was already sent to tpm before report reviewer has become mandatory, apply old logic - recipients = self.country_pmes + recipients.add(self.report_reviewer) if self.monitor_type == self.MONITOR_TYPE_CHOICES.staff: email_template = 'fm/activity/staff-submit' diff --git a/src/etools/applications/field_monitoring/planning/tests/test_views.py b/src/etools/applications/field_monitoring/planning/tests/test_views.py index 0600c9d79..d457a4799 100644 --- a/src/etools/applications/field_monitoring/planning/tests/test_views.py +++ b/src/etools/applications/field_monitoring/planning/tests/test_views.py @@ -389,9 +389,9 @@ def goto(next_status, user, extra_data=None, mail_count=None): goto('data_collection', visit_lead) goto('report_finalization', visit_lead) goto('submitted', visit_lead, {'report_reviewer': UserFactory(report_reviewer=True).id}, - mail_count=1) + mail_count=activity.country_pmes.count() + 1) # +1: send to report reviewer if set goto('report_finalization', self.pme, mail_count=1) - goto('submitted', visit_lead, mail_count=activity.country_pmes.count()) + goto('submitted', visit_lead, mail_count=activity.country_pmes.count() + 1) # +1: send to report reviewer if set goto('completed', self.pme) activity.status = "submitted" activity.save(update_fields=["status"])