Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix for close out email notification #86

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions met-api/src/met_api/services/engagement_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from met_api.exceptions.business_exception import BusinessException
from met_api.models.engagement import Engagement as EngagementModel
from met_api.models.engagement_scope_options import EngagementScopeOptions
from met_api.models.engagement_settings import EngagementSettingsModel
from met_api.models.engagement_slug import EngagementSlug as EngagementSlugModel
from met_api.models.engagement_status_block import EngagementStatusBlock as EngagementStatusBlockModel
from met_api.models.pagination_options import PaginationOptions
Expand Down Expand Up @@ -131,8 +132,12 @@ def _get_scope_options(user_roles, has_team_access):
def close_engagements_due():
"""Close published engagements that are due for a closeout."""
engagements = EngagementModel.close_engagements_due()
results = [EngagementService._send_closeout_emails(engagement) for engagement in engagements]
return results
for engagement in engagements:
engagement_settings: EngagementSettingsModel =\
EngagementSettingsModel.find_by_id(engagement.id)
if engagement_settings:
if engagement_settings.send_report:
EngagementService._send_closeout_emails(engagement)

@staticmethod
def publish_scheduled_engagements():
Expand Down
Loading