-
Notifications
You must be signed in to change notification settings - Fork 286
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
Bugfix: in subscriptions.create, trial_days using timezone naive utcnow() and add test #576
Conversation
Codecov Report
@@ Coverage Diff @@
## master #576 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 33 33
Lines 1917 1917
Branches 175 175
=======================================
Hits 1902 1902
Misses 7 7
Partials 8 8
Continue to review full report at Codecov.
|
@@ -48,7 +48,7 @@ def create(customer, plan, quantity=None, trial_days=None, token=None, coupon=No | |||
|
|||
subscription_params = {} | |||
if trial_days: | |||
subscription_params["trial_end"] = datetime.datetime.utcnow() + datetime.timedelta(days=trial_days) | |||
subscription_params["trial_end"] = datetime.datetime.now(tz=timezone.utc) + datetime.timedelta(days=trial_days) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using django.utils.timezone.now()
?
It seems to be used in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed another occurrence in #577 for consistency.
…ow() - Changed to timezone.now() - Add test Fixed pinax#573
de9dcfb
to
c987308
Compare
@blueyed yeah, i agree it's better and I have changed the code accordingly. |
Bugfix: in subscriptions.create, trial_days using timezone naive utcnow() and add test
Fixes #573
What's this PR do?
Bugfix: in subscriptions.create, trial_days using timezone naive utcnow() and add test
Any background context you want to provide?
Issue #573
What ticket or issue # does this fix?
Issue #573
Closes #573
Definition of Done (check if considered and/or addressed):