diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 883380381..031964adc 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,11 +1,3 @@ -# Change Log - -All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). - -## December 28, 2023 - -> **Feature**: Added the timeline widget. [🎟️DESENG-439](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-439) - ## January 9, 2024 - **Task** Improvements from Epic [🎟️DESENG-468](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-468) @@ -15,6 +7,12 @@ All notable changes to this project will be documented in this file. This projec - Formio Version Update - Enable Survey Editing for Open Engagements +- **Bug Fix**: Fixing timezone issue while publishing using met cron [🎟️DESENG-437](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-437) + +## December 28, 2023 + +> **Feature**: Added the timeline widget. [🎟️DESENG-439](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-439) + ## December 11, 2023 - **Task** Merge `gdx-sso`, `gdx-dev`, `gdx-main` into `main` [🎟️DESENG-442](https://apps.itsm.gov.bc.ca/jira/browse/DESENG-442) diff --git a/met-api/src/met_api/config.py b/met-api/src/met_api/config.py index 9b0b76216..48959c202 100644 --- a/met-api/src/met_api/config.py +++ b/met-api/src/met_api/config.py @@ -86,7 +86,7 @@ def __init__(self) -> None: in the normal class definition. """ # If extending this class, call super().__init__() in your constructor. - print(f'SQLAlchemy URL: {self.sqlalchemy_database_uri}') + print(f'SQLAlchemy URL: {self.SQLALCHEMY_DATABASE_URI}') # apply configs to _Config in the format that flask_jwt_oidc expects # this flattens the JWT_CONFIG dict into individual attributes @@ -97,7 +97,7 @@ def __init__(self) -> None: os.environ['FLASK_DEBUG'] = str(self.USE_DEBUG) @property - def sqlalchemy_database_uri(self) -> str: + def SQLALCHEMY_DATABASE_URI(self) -> str: """ Dynamically fetch the SQLAlchemy Database URI based on the DB config. diff --git a/met-api/src/met_api/models/engagement.py b/met-api/src/met_api/models/engagement.py index 5315937c6..3a5980615 100644 --- a/met-api/src/met_api/models/engagement.py +++ b/met-api/src/met_api/models/engagement.py @@ -172,8 +172,8 @@ def close_engagements_due(cls) -> List[Engagement]: @classmethod def publish_scheduled_engagements_due(cls) -> List[Engagement]: """Update scheduled engagements to published.""" - datetime_due = datetime.now() - print('Publish due date ------------------------', datetime_due) + datetime_due = datetime.utcnow() + print('Publish due date (UTC) ------------------------', datetime_due) update_fields = dict( status_id=Status.Published.value, published_date=datetime.utcnow(), diff --git a/met-api/src/met_api/services/engagement_service.py b/met-api/src/met_api/services/engagement_service.py index be7c562d4..0c75ab67f 100644 --- a/met-api/src/met_api/services/engagement_service.py +++ b/met-api/src/met_api/services/engagement_service.py @@ -137,6 +137,11 @@ def close_engagements_due(): def publish_scheduled_engagements(): """Publish scheduled engagement due.""" engagements = EngagementModel.publish_scheduled_engagements_due() + + if not engagements: + print('There are no engagements scheduled for publication') + return None + print('Engagements published: ', engagements) for engagement in engagements: email_util.publish_to_email_queue(SourceType.ENGAGEMENT.value, engagement.id,