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

AAP-31447: reports: use django.utils.timezone.now() to get the current day #1311

Conversation

goneri
Copy link
Contributor

@goneri goneri commented Sep 17, 2024

We want to use the django.utils.timezone.now() to get a date with UTC TZ.

@goneri goneri requested a review from manstis September 17, 2024 18:46
@goneri goneri marked this pull request as draft September 17, 2024 18:48
manstis
manstis previously approved these changes Sep 17, 2024
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Great catch.

@goneri
Copy link
Contributor Author

goneri commented Sep 17, 2024

I converted this to draft until we get the full story from Marty and some proper unit-tests.

@goneri goneri force-pushed the goneri/reports-use-django.utils.timezone.now-to-get-the-current-day_32731 branch from c03ba25 to 26ee2f7 Compare September 17, 2024 19:51
@goneri goneri marked this pull request as ready for review September 17, 2024 19:52
@goneri goneri requested a review from manstis September 17, 2024 20:03
@goneri goneri changed the title reports: use django.utils.timezone.now() to get the current day AAP-31447: reports: use django.utils.timezone.now() to get the current day Sep 17, 2024
manstis
manstis previously approved these changes Sep 17, 2024
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

The test doesn't assert use of timezone and 20999999_my_report.csv would pass. I suspect the test was written to keep SonarCloud happy.... but it's better than nothing.

…t day

We want to use the `django.utils.timezone.now()` to get a date with UTC TZ.
@goneri goneri force-pushed the goneri/reports-use-django.utils.timezone.now-to-get-the-current-day_32731 branch from 26ee2f7 to a04ffed Compare September 18, 2024 20:50
@goneri
Copy link
Contributor Author

goneri commented Sep 18, 2024

The test doesn't assert use of timezone and 20999999_my_report.csv would pass. I suspect the test was written to keep SonarCloud happy.... but it's better than nothing.

Agreed. I'm now doing a parameter validation inside the function.

@goneri goneri requested a review from manstis September 18, 2024 20:51
Copy link
Contributor

@manstis manstis left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM 👍

Copy link

sonarcloud bot commented Sep 18, 2024

@goneri goneri merged commit 9f010b1 into main Sep 18, 2024
12 checks passed
@goneri goneri deleted the goneri/reports-use-django.utils.timezone.now-to-get-the-current-day_32731 branch September 18, 2024 21:08
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.

2 participants