vvangelovski / django-audit-log

Audit log for your Django models
Other
232 stars 93 forks source link

Ensure audit_date field is timezone-aware if USE_TZ is true #11

Closed hellsgate1001 closed 10 years ago

hellsgate1001 commented 11 years ago

Hi, Django > 1.4 uses the USE_TZ setting to determine if dates and datetimes are timezone aware. This causes a warning when using audit log as the audit_date field isn't timezone aware. This edit fixes that. Also, apologies for the whitespace cleanup, its the result of a setting in my IDE. If this is a problem, let me know and I'll issue another request with only the code changes.

vvangelovski commented 10 years ago

I think both of these are solved now. Albeit a bit differently. I'm not sure about the TZ issue. But It seems that just setting the field default to auto_now_add solves the problem. I have to do some testing for this.