Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1336 -- made USStateField work correctly when data is None (th…

…anks, chrisb)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f15a983d88328f87b35390b827e3a747c6bf181b 1 parent da310cf
Jacob Kaplan-Moss authored February 27, 2006

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  django/core/formfields.py
5  django/core/formfields.py
@@ -875,7 +875,10 @@ def isValidUSState(self, field_data, all_data):
875 875
             raise validators.CriticalValidationError, e.messages
876 876
 
877 877
     def html2python(data):
878  
-        return data.upper() # Should always be stored in upper case
  878
+        if data:
  879
+            return data.upper() # Should always be stored in upper case
  880
+        else:
  881
+            return None
879 882
     html2python = staticmethod(html2python)
880 883
 
881 884
 class CommaSeparatedIntegerField(TextField):

0 notes on commit f15a983

Please sign in to comment.
Something went wrong with that request. Please try again.