Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
bc3849bd
Commit
bc3849bd
authored
Jan 18, 2017
by
Asif Saifuddin Auvi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added utc compat to fields
parent
5717e853
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
rest_framework/fields.py
+2
-2
No files found.
rest_framework/fields.py
View file @
bc3849bd
...
@@ -32,7 +32,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -32,7 +32,7 @@ from django.utils.translation import ugettext_lazy as _
from
rest_framework
import
ISO_8601
from
rest_framework
import
ISO_8601
from
rest_framework.compat
import
(
from
rest_framework.compat
import
(
get_remote_field
,
unicode_repr
,
unicode_to_repr
,
value_from_object
get_remote_field
,
unicode_repr
,
unicode_to_repr
,
value_from_object
,
utc
)
)
from
rest_framework.exceptions
import
ErrorDetail
,
ValidationError
from
rest_framework.exceptions
import
ErrorDetail
,
ValidationError
from
rest_framework.settings
import
api_settings
from
rest_framework.settings
import
api_settings
...
@@ -1104,7 +1104,7 @@ class DateTimeField(Field):
...
@@ -1104,7 +1104,7 @@ class DateTimeField(Field):
if
(
field_timezone
is
not
None
)
and
not
timezone
.
is_aware
(
value
):
if
(
field_timezone
is
not
None
)
and
not
timezone
.
is_aware
(
value
):
return
timezone
.
make_aware
(
value
,
field_timezone
)
return
timezone
.
make_aware
(
value
,
field_timezone
)
elif
(
field_timezone
is
None
)
and
timezone
.
is_aware
(
value
):
elif
(
field_timezone
is
None
)
and
timezone
.
is_aware
(
value
):
return
timezone
.
make_naive
(
value
,
timezone
.
UTC
()
)
return
timezone
.
make_naive
(
value
,
utc
)
return
value
return
value
def
default_timezone
(
self
):
def
default_timezone
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment