Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone Awareness for CreationDateTimeField #41

Open
bobort opened this issue Nov 8, 2016 · 0 comments
Open

Timezone Awareness for CreationDateTimeField #41

bobort opened this issue Nov 8, 2016 · 0 comments

Comments

@bobort
Copy link

bobort commented Nov 8, 2016

When saving a model with a CreationDateTimeField, I am getting the error that the field value is not timezone aware. (I have enabled timezone aware exceptions to happen in my Django development server.)

It is actually due to an issue in the Django code. From what I was reading, there have been debates to deprecate the auto_now and auto_now_add keyword arguments on DateTimeFields, but it hasn't happened yet and there haven't been any updates to that portion of their code base. I'm looking at it right now and wish I could just so easily change it for them.

The django-audit-log CreationDateTimeField and ModificationDateTimeField take advantage of these two keyword arguments. The general workaround seems to be to change the default value to timezone.now instead of utilizing those keyword arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant