mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #13390 -- SplitDateTimeWidget now recognizes when it's no longer required. Thanks vaxXxa for bug report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -399,6 +399,8 @@ class DateTimeField(Field):
|
||||
# components: date and time.
|
||||
if len(value) != 2:
|
||||
raise ValidationError(self.error_messages['invalid'])
|
||||
if value[0] in validators.EMPTY_VALUES and value[1] in validators.EMPTY_VALUES:
|
||||
return None
|
||||
value = '%s %s' % tuple(value)
|
||||
for format in self.input_formats or formats.get_format('DATETIME_INPUT_FORMATS'):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user