Permalink
Browse files

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
  • Loading branch information...
1 parent 9b72153 commit d86624877de7b7db91c2966dd9bfa6ef8721b29e @adrianholovaty adrianholovaty committed Sep 27, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/core/formfields.py
View
2 django/core/formfields.py
@@ -652,7 +652,7 @@ def html2python(data):
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)

0 comments on commit d866248

Please sign in to comment.