dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
666 stars 187 forks source link

net: Make datetime objects timezone aware #291

Closed XePeleato closed 8 months ago

XePeleato commented 8 months ago

I am receiving very frequent: /usr/local/lib/python3.10/dist-packages/django/db/models/fields/__init__.py:1654: RuntimeWarning: DateTimeField ProcessSubmissions.watchdog received a naive datetime (2024-01-30 11:07:38.550017) while time zone support is active. warnings.

According to Django docs (https://django.readthedocs.io/en/stable/topics/i18n/timezones.html), this is the correct way to convert them.

It shouldn't make a mess with an existing database, as Django converts those anyway.

dstndstn commented 8 months ago

Thanks for this!