DateFieldListFilter "Past 7 days" filter uses naive datetime when USE_TZ is set.
The "Past 7 days" link for the DateFieldListFilter always contains a serialized naive datetime. This becomes a problem when USE_TZ is set because that value with get parsed back into a naive datetime and used directly in a QuerySet.filter call. The warning about using a naive data time will be raised.
Change History
(6)
| Owner: |
changed from nobody to Aymeric Augustin
|
| Triage Stage: |
Unreviewed → Accepted
|
| Severity: |
Normal → Release blocker
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
new → closed
|
To fix this problem, I had to modify
DateFieldListFilterto avoid the__year,__monthand__daylookups -- because of #17260, these don't work well when time zone support is enabled.