diff options
| author | Tom Christie | 2013-06-28 09:35:52 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-06-28 09:35:52 +0100 |
| commit | 4ee9cdc7aff30fc3f45e78292da77b5989bb0e23 (patch) | |
| tree | 29479ef6d4cd3d2d1019e2d22dcef4262fcd18b2 | |
| parent | 1f6a59d76da286e7a89e8e41317beb16a4aab7c7 (diff) | |
| download | django-rest-framework-4ee9cdc7aff30fc3f45e78292da77b5989bb0e23.tar.bz2 | |
Fix compat datetime import when oauth2 provide does not support timezone aware datetimes
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | rest_framework/compat.py | 3 |
2 files changed, 3 insertions, 1 deletions
@@ -4,6 +4,7 @@ .* html/ +htmlcov/ coverage/ build/ dist/ diff --git a/rest_framework/compat.py b/rest_framework/compat.py index b748dcc5..cb122846 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -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 |
