Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use tz aware datetime in filter for DateTimeFields
DateTimeFields are time zone aware fields, filtering using date objects seems to create naive datetime objects to compare to, which triggers a Django warning "DateTimeField Shift.ending_time received a naive datetime (...) while time zone support is active." Also, using time.min also is not tz aware. We need to construct a time(tzinfo=get_current_timezone()) which corresponds to 0:00:00.0 at the default time zone (settings.TIME_ZONE, ie. Europe/Berlin)
- Loading branch information