Skip to content

Commit

Permalink
Fixed #213 -- Improved formfields.TimeField.html2python() so that it …
Browse files Browse the repository at this point in the history
…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
adrianholovaty committed Sep 27, 2005
1 parent 9b72153 commit d866248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/core/formfields.py
Expand Up @@ -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)

Expand Down

0 comments on commit d866248

Please sign in to comment.