#28245 closed Bug (invalid)
timezone.UTC() is not exported, but is attempted to be accessed
Reported by: | Christopher Dieringer | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.11 |
Severity: | Normal | Keywords: | utc, fields, timezone |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
problem statement
timezone.UTC()
is called, but no such function is exported.
solution
it seems that mapping timezone.UTC() ==> timezone.utc may be what is desired
how to reproduce
- send an ISO compliant datetime w/ UTC offset to a DateTimeField(), e.g.
2017-05-30T17:17:21-07:00
stack
the pertinent part of the stack here reveals all:
File "/path/to/rest_framework/fields.py" in to_internal_value
- return self.enforce_timezone(parsed)
File "/path/to/rest_framework/fields.py" in enforce_timezone
- return timezone.make_naive(value, timezone.UTC())
Exception Type: AttributeError at /rest/v1/api/schedules
Exception Value: module 'django.utils.timezone' has no attribute 'UTC'
Change History (2)
comment:1 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 7 years ago
Resolution: | wontfix → invalid |
---|
Note:
See TracTickets
for help on using tickets.
whoops, wrong project :(