Lucterios2 / django_auth_ldap3_ad

Simple LDAP/AD auth module for django
https://pypi.python.org/pypi/django-auth-ldap3-ad
GNU General Public License v3.0
45 stars 25 forks source link

Use the correct now() #29

Closed menesis closed 4 years ago

menesis commented 5 years ago

Everytime a user logs in, I see RuntimeWarning: DateTimeField received a naive datetime (...) while time zone support is active. in Apache logs. This is because the naive datetime.datetime.now() is used to get time. django.utils.timezone.now() respects USE_TZ setting to produce a naive or timezone-aware time for storing in the database.

Additionally, I removed now() from all logging calls, because time is an essential property of log record.