diff --git a/met-api/src/met_api/models/survey.py b/met-api/src/met_api/models/survey.py index 773bcd898..be4e7826e 100644 --- a/met-api/src/met_api/models/survey.py +++ b/met-api/src/met_api/models/survey.py @@ -45,7 +45,9 @@ class Survey(BaseModel): # pylint: disable=too-few-public-methods def get_open(cls, survey_id) -> Survey: """Get an open survey.""" now = local_datetime().date() # Get the current PST date without the timestamp - extended_end_date = Engagement.end_date + timedelta(days=1, hours=8) # Calculate the threshold time (8 hours after the end_date) + + # Calculate the threshold time (8 hours after the end_date) + extended_end_date = Engagement.end_date + timedelta(days=1, hours=8) survey: Survey = db.session.query(Survey).filter_by(id=survey_id) \ .join(Engagement) \ diff --git a/met-api/src/met_api/services/survey_service.py b/met-api/src/met_api/services/survey_service.py index b184e3153..3a968d08f 100644 --- a/met-api/src/met_api/services/survey_service.py +++ b/met-api/src/met_api/services/survey_service.py @@ -48,7 +48,7 @@ def get(cls, survey_id): # Get the current local datetime current_datetime = local_datetime().replace(tzinfo=None) if ((engagement_model.status_id == Status.Published.value) or - (engagement_model.status_id == Status.Closed.value and current_datetime <= extended_end_date)): + (engagement_model.status_id == Status.Closed.value and current_datetime <= extended_end_date)): # Published Engagement anyone can access. skip_auth = True else: