Ticket #14859: 14859.diff

File 14859.diff, 935 bytes (added by Idan Gazit, 14 years ago)
  • django/contrib/localflavor/it/forms.py

    diff --git a/django/contrib/localflavor/it/forms.py b/django/contrib/localflavor/it/forms.py
    index baa56a2..bf02276 100644
    a b class ITSocialSecurityNumberField(RegexField):  
    5050
    5151    def clean(self, value):
    5252        value = super(ITSocialSecurityNumberField, self).clean(value)
    53         if value == u'':
    54             return value
     53        if value in EMPTY_VALUES:
     54            return u''
    5555        value = re.sub('\s', u'', value).upper()
    5656        try:
    5757            check_digit = ssn_check_digit(value)
    class ITVatNumberField(Field):  
    7171
    7272    def clean(self, value):
    7373        value = super(ITVatNumberField, self).clean(value)
    74         if value == u'':
    75             return value
     74        if value in EMPTY_VALUES:
     75            return u''
    7676        try:
    7777            vat_number = int(value)
    7878        except ValueError:
Back to Top