Ticket #14499: 14499.diff

File 14499.diff, 840 bytes (added by Idan Gazit, 8 years ago)
  • django/contrib/localflavor/at/forms.py

    diff --git a/django/contrib/localflavor/at/forms.py b/django/contrib/localflavor/at/forms.py
    index e428fda..cacd4a6 100644
    a b AT-specific Form helpers 
    44
    55import re
    66
     7from django.core.validators import EMPTY_VALUES
    78from django.utils.translation import ugettext_lazy as _
    89from django.forms.fields import Field, RegexField, Select
    910from django.forms import ValidationError
    class ATSocialSecurityNumberField(Field): 
    4950    }
    5051
    5152    def clean(self, value):
     53        super(ATSocialSecurityNumberField, self).clean(value)
     54        if value in EMPTY_VALUES:
     55            return u''
    5256        if not re_ssn.search(value):
    5357            raise ValidationError(self.error_messages['invalid'])
    5458        sqnr, date = value.split(" ")
Back to Top