mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-24 10:34:03 +03:00
Fix compat datetime import when oauth2 provide does not support timezone aware datetimes
This commit is contained in:
parent
1f6a59d76d
commit
4ee9cdc7af
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,6 +4,7 @@
|
|||
.*
|
||||
|
||||
html/
|
||||
htmlcov/
|
||||
coverage/
|
||||
build/
|
||||
dist/
|
||||
|
|
|
@ -494,7 +494,8 @@ try:
|
|||
if provider_version in ('0.2.3', '0.2.4'):
|
||||
# 0.2.3 and 0.2.4 are supported version that do not support
|
||||
# timezone aware datetimes
|
||||
from datetime.datetime import now as provider_now
|
||||
import datetime
|
||||
provider_now = datetime.datetime.now
|
||||
else:
|
||||
# Any other supported version does use timezone aware datetimes
|
||||
from django.utils.timezone import now as provider_now
|
||||
|
|
Loading…
Reference in New Issue
Block a user