Skip to content

Commit

Permalink
bug fix for close out email notification (#86)
Browse files Browse the repository at this point in the history
* bug fix for close out email notification

* fixing linting
  • Loading branch information
VineetBala-AOT authored Sep 16, 2024
1 parent 5d8fab4 commit b57be53
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit b57be53

Please sign in to comment.