Ticket #14871: 14871.diff

File 14871.diff, 672 bytes (added by Idan Gazit, 14 years ago)
  • django/contrib/localflavor/za/forms.py

    diff --git a/django/contrib/localflavor/za/forms.py b/django/contrib/localflavor/za/forms.py
    index 9a54f1e..f501aa0 100644
    a b class ZAIDField(Field):  
    2222    }
    2323
    2424    def clean(self, value):
    25         # strip spaces and dashes
    26         value = value.strip().replace(' ', '').replace('-', '')
    27 
    2825        super(ZAIDField, self).clean(value)
    2926
    3027        if value in EMPTY_VALUES:
    3128            return u''
    3229
     30        # strip spaces and dashes
     31        value = value.strip().replace(' ', '').replace('-', '')
     32
    3333        match = re.match(id_re, value)
    3434
    3535        if not match:
Back to Top