Empty value on optional DateInputField causes error
KIRA009 opened this issue · comments
Shohan commented
Description
A form that has an optional DateInputField
raises a ValueError
if user submits the form leaving the date field blank.
Cause
This is caused by
Line 123 in f1f5c26
Lines 170 to 182 in f1f5c26
data_list
to be a 3-tuple
and instead receives an empty list
Solution
The solution, unless I am missing something, is to simply check if data_list
indeed contains 3 values, before unpacking them
if len(data_list) != 3:
return None