Monday, November 24, 2014

Dumbest Bug Ever

Been looking all around on how to solve this particular bug for the whole day today. The problem is the field in the form does not auto-convert the datetime object to local time, even though I've declared USE_TZ=True and set the correct TIME_ZONE in the settings.py

Turns out it's because I used forms.DateField instead of forms.DateTimeField inside my forms for those DateTime fields.

*facetable*

Reminder to self: Look for the most obvious things first when debugging. Compare whether the fields in the models and forms are declared properly. Check other similar forms and see whether this problem occurs or not before assuming this is a global bug.

No comments: