mirror of https://github.com/django/django.git
Fixed #213 -- Improved formfields.TimeField.html2python() so that it doesn't fail for None input
git-svn-id: http://code.djangoproject.com/svn/django/trunk@702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9b72153139
commit
d86624877d
|
@ -652,7 +652,7 @@ class TimeField(TextField):
|
|||
except ValueError: # seconds weren't provided
|
||||
time_tuple = time.strptime(data, '%H:%M')
|
||||
return datetime.time(*time_tuple[3:6])
|
||||
except ValueError:
|
||||
except (ValueError, TypeError):
|
||||
return None
|
||||
html2python = staticmethod(html2python)
|
||||
|
||||
|
|
Loading…
Reference in New Issue