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

RAS-1378 Fix datetime deprecation warning on party service #448

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

arroyoAle
Copy link
Contributor

@arroyoAle arroyoAle commented Dec 6, 2024

What and why?

Delegates the created_on time retrieval to the built in database method (which saves it in UTC without timezone information - as we have been doing with datetime anyway). This solves the issue we were seeing with using the "new" datetime.now(UTC) function replacing the deprecated datetime.utcnow() function, which was using the time checked at app startup in the models and not evaluating on each column creation. The instances in the pending survey deletion cron job are evaluated on each request and therefore work as they should.

How to test?

  • deploy to your env
  • run the acceptance tests
  • check the created on time for the new party
  • create a new account in frontstage
  • check the time is not set to almost the same but the correct time the account was created
  • share the survey to the other account you have
  • check that there is a pending survey share in the pending_surveys table
  • run kubectl edit deployments party and edit the EMAIL_TOKEN_EXPIRY to a more reasonable number from 3 days
    • or edit it through the gcloud user interface
  • save the changes
  • check that after the cron runs the pending survey entry has been deleted from the table

Jira

RAS-1378

@arroyoAle arroyoAle marked this pull request as ready for review December 9, 2024 13:45
Copy link
Contributor

@LJBabbage LJBabbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked fine for me. I just changed the date in the db for pending survey, seemed easier

Copy link
Contributor

@matthew-robinson-ons matthew-robinson-ons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, times all look accurate and pending survey is deleted as expected.

@arroyoAle arroyoAle merged commit af73b37 into main Dec 13, 2024
1 check passed
@arroyoAle arroyoAle deleted the updating-datetime-usage branch December 13, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants