[Answered ]-Django 1.4 Want to make birthdate field utilizing SelectDateWidget not required on my form

2👍

I expect your problem derives from the fact that:

settingForm.cleaned_data.get('birthdate')

won’t return None but hands you an empty string '' which isn’t what the Date or DateTime field expects.

You should return a NoneType if the user hasn’t actually selected a date.

Leave a comment