Ticket #14865: 14865.diff

File 14865.diff, 1.2 KB (added by Idan Gazit, 13 years ago)
  • django/contrib/localflavor/ro/forms.py

    diff --git a/django/contrib/localflavor/ro/forms.py b/django/contrib/localflavor/ro/forms.py
    index 3b168c0..a218bfd 100644
    a b class ROCNPField(RegexField):  
    6565        CNP validations
    6666        """
    6767        value = super(ROCNPField, self).clean(value)
     68        if value in EMPTY_VALUES:
     69            return u''
    6870        # check birthdate digits
    6971        import datetime
    7072        try:
    class ROIBANField(RegexField):  
    150152        Strips - and spaces, performs country code and checksum validation
    151153        """
    152154        value = super(ROIBANField, self).clean(value)
     155        if value in EMPTY_VALUES:
     156            return u''
    153157        value = value.replace('-','')
    154158        value = value.replace(' ','')
    155159        value = value.upper()
    class ROPhoneNumberField(RegexField):  
    180184        Strips -, (, ) and spaces. Checks the final length.
    181185        """
    182186        value = super(ROPhoneNumberField, self).clean(value)
     187        if value in EMPTY_VALUES:
     188            return u''
    183189        value = value.replace('-','')
    184190        value = value.replace('(','')
    185191        value = value.replace(')','')
Back to Top