Ticket #14750: 14750.diff

File 14750.diff, 876 bytes (added by Idan Gazit, 14 years ago)
  • django/contrib/localflavor/il/forms.py

    diff --git a/django/contrib/localflavor/il/forms.py b/django/contrib/localflavor/il/forms.py
    index bbf95d2..a143587 100644
    a b Israeli-specific form helpers  
    44import re
    55
    66from django.core.exceptions import ValidationError
     7from django.core.validators import EMPTY_VALUES
    78from django.forms.fields import RegexField, Field, EMPTY_VALUES
    89from django.utils.checksums import luhn
    910from django.utils.translation import ugettext_lazy as _
    class ILPostalCodeField(RegexField):  
    3435        super(ILPostalCodeField, self).__init__(r'^\d{5}$', *args, **kwargs)
    3536
    3637    def clean(self, value):
    37         if value is not None:
     38        if value not in EMPTY_VALUES:
    3839            value = value.replace(" ", "")
    3940        return super(ILPostalCodeField, self).clean(value)
    4041
Back to Top