hltcoe / turkle

Django-based clone of Amazon's Mechanical Turk service running in your local environment.
https://turkle.readthedocs.io
Other
147 stars 47 forks source link

warning when filtering stats by date when timezone use is on #180

Closed cash closed 2 years ago

cash commented 2 years ago

here is the warning: RuntimeWarning: DateTimeField TaskAssignment.updated_at received a naive datetime (2022-04-13 00:00:00) while time zone support is active.

The parse_date() function returns a date object when is used to filter based on updated_at__gte. The filter converts the date object to datetime without timezone information which is now required in Django when USE_TZ is set to True in settings.