1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #34424 -- Fixed SelectDateWidget crash for inputs raising OverflowError.

This commit is contained in:
Jure Slak
2023-03-20 22:42:18 +01:00
committed by Mariusz Felisiak
parent b4870e7196
commit d22209cb42
3 changed files with 16 additions and 0 deletions

View File

@@ -1161,6 +1161,8 @@ class SelectDateWidget(Widget):
# Return pseudo-ISO dates with zeros for any unselected values,
# e.g. '2017-0-23'.
return "%s-%s-%s" % (y or 0, m or 0, d or 0)
except OverflowError:
return "0-0-0"
return date_value.strftime(input_format)
return data.get(name)