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:
Adrian Holovaty 2005-09-27 03:34:58 +00:00
parent 9b72153139
commit d86624877d
1 changed files with 1 additions and 1 deletions

View File

@ -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)