Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
VineetBala-AOT authored Sep 10, 2024
1 parent 2c6f864 commit b58d9f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion met-api/src/met_api/models/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion met-api/src/met_api/services/survey_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b58d9f3

Please sign in to comment.