id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux
2674 [patch] entering an invalid day of month for DateField and DateTimeField fields results in NULL value Gary Wilson Adrian Holovaty "If you try to enter a date where the day is out of range for the month, like `2006-11-31`, django will try to insert a NULL value for that field. These dates get past the `isValidANSIDate` validator's regular expression. Maybe it would be best to use another validator that uses datetime, as it knows that this is an invalid date...
{{{
#!python
>>> datetime.datetime(2006,11,31)
Traceback (most recent call last):
File """", line 1, in ?
ValueError: day is out of range for month
}}}
and `isValidANSIDate` could use a simpler regular expression that just checks for a `YYYY-MM-DD` format." defect closed contrib.admin master normal fixed gary.wilson@… Unreviewed 1 0 0 0