From 81c839014d85161e851cc8c1d408055adcd94021 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 25 Jan 2007 00:43:44 +0000 Subject: [PATCH] Fixed #1336 -- USStateField no longer throws exception when data is None git-svn-id: http://code.djangoproject.com/svn/django/trunk@4422 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/oldforms/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/oldforms/__init__.py b/django/oldforms/__init__.py index b437109596..decf0f7064 100644 --- a/django/oldforms/__init__.py +++ b/django/oldforms/__init__.py @@ -958,7 +958,9 @@ class USStateField(TextField): raise validators.CriticalValidationError, e.messages def html2python(data): - return data.upper() # Should always be stored in upper case + if data: + return data.upper() # Should always be stored in upper case + return data html2python = staticmethod(html2python) class CommaSeparatedIntegerField(TextField):