{"action":"opened","issue":{"url":"https://api.github.com/repos/blueprinthealth/django-auditlog/issues/5","labels_url":"https://api.github.com/repos/blueprinthealth/django-auditlog/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/blueprinthealth/django-auditlog/issues/5/comments","events_url":"https://api.github.com/repos/blueprinthealth/django-auditlog/issues/5/events","html_url":"https://github.com/blueprinthealth/django-auditlog/issues/5","id":105037861,"number":5,"title":"Model save() exception when using TZ aware DateTimeFields","user":{"login":"bijanvakili","id":5158112,"avatar_url":"https://avatars.githubusercontent.com/u/5158112?v=3","gravatar_id":"","url":"https://api.github.com/users/bijanvakili","html_url":"https://github.com/bijanvakili","followers_url":"https://api.github.com/users/bijanvakili/followers","following_url":"https://api.github.com/users/bijanvakili/following{/other_user}","gists_url":"https://api.github.com/users/bijanvakili/gists{/gist_id}","starred_url":"https://api.github.com/users/bijanvakili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bijanvakili/subscriptions","organizations_url":"https://api.github.com/users/bijanvakili/orgs","repos_url":"https://api.github.com/users/bijanvakili/repos","events_url":"https://api.github.com/users/bijanvakili/events{/privacy}","received_events_url":"https://api.github.com/users/bijanvakili/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/blueprinthealth/django-auditlog/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-05T17:04:53Z","updated_at":"2015-09-05T17:04:53Z","closed_at":null,"body":"While using regression tests with timestamps localized by ```pytz```, ```auditlog``` will throw an exception when ```create_change_object``` checks the updated values for ```DateTimeField``` if only one of the values is localized with a timezone.\r\n\r\nHere's an example test where the ```encounter_scheduled_time``` was updated to a tz-aware timestamp (using ```pytz```) which throws an exception.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/bvakili/Development/blueprint/bph_api/payments/tests/eligibility_test.py\", line 347, in test_chargegroup_eligibility_requests\r\n    encounter.save()\r\n  File \"/Users/bvakili/.virtualenvs/blueprint/lib/python2.7/site-packages/django/db/models/base.py\", line 734, in save\r\n    force_update=force_update, update_fields=update_fields)\r\n  File \"/Users/bvakili/.virtualenvs/blueprint/lib/python2.7/site-packages/django/db/models/base.py\", line 771, in save_base\r\n    update_fields=update_fields, raw=raw, using=using)\r\n  File \"/Users/bvakili/.virtualenvs/blueprint/lib/python2.7/site-packages/django/dispatch/dispatcher.py\", line 201, in send\r\n    response = receiver(signal=self, sender=sender, **named)\r\n  File \"/Users/bvakili/.virtualenvs/blueprint/lib/python2.7/site-packages/auditlog/audit.py\", line 133, in post_save_handler\r\n    self.create_change_object(instance, action)\r\n  File \"/Users/bvakili/.virtualenvs/blueprint/lib/python2.7/site-packages/auditlog/audit.py\", line 149, in create_change_object\r\n    if old_value != new_value:\r\nTypeError: can't compare offset-naive and offset-aware datetimes\r\n```\r\n\r\nShould special behavior be added for ```DateTimeField``` columns?"}}