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

Changed timezone.now import to from django.utils import timezone #643

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

sevetseh28
Copy link
Contributor

@sevetseh28 sevetseh28 commented Apr 15, 2020

I changed the way the now function from django is imported and executed following the Django standard of using it: https://docs.djangoproject.com/en/3.0/topics/i18n/timezones/

If you have tests that mock django.utils.timezone.now it will also work now, so you don't have to patch twice. Besides, it is clearer to specify the timezone module, since now is found in many modules.

Description

It's a very simple PR, the summary has all details.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run the make format command to format my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or github handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

@sevetseh28 sevetseh28 marked this pull request as ready for review April 15, 2020 12:55
mahsa-lotfi92
mahsa-lotfi92 previously approved these changes Apr 15, 2020
Copy link
Collaborator

@rossmechanic rossmechanic left a comment

Choose a reason for hiding this comment

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

Thanks @sevetseh28 !

@rossmechanic rossmechanic merged commit 5d91356 into jazzband:master Apr 15, 2020
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.

3 participants