diff --git a/django/contrib/localflavor/pl/forms.py b/django/contrib/localflavor/pl/forms.py
index b908580..d1e9773 100644
a
|
b
|
import re
|
7 | 7 | from django.forms import ValidationError |
8 | 8 | from django.forms.fields import Select, RegexField |
9 | 9 | from django.utils.translation import ugettext_lazy as _ |
| 10 | from django.core.validators import EMPTY_VALUES |
10 | 11 | |
11 | 12 | class PLProvinceSelect(Select): |
12 | 13 | """ |
… |
… |
class PLPESELField(RegexField):
|
45 | 46 | |
46 | 47 | def clean(self,value): |
47 | 48 | super(PLPESELField, self).clean(value) |
| 49 | if value in EMPTY_VALUES: |
| 50 | return u'' |
48 | 51 | if not self.has_valid_checksum(value): |
49 | 52 | raise ValidationError(self.error_messages['checksum']) |
50 | 53 | return u'%s' % value |
… |
… |
class PLNIPField(RegexField):
|
78 | 81 | |
79 | 82 | def clean(self,value): |
80 | 83 | super(PLNIPField, self).clean(value) |
| 84 | if value in EMPTY_VALUES: |
| 85 | return u'' |
81 | 86 | value = re.sub("[-]", "", value) |
82 | 87 | if not self.has_valid_checksum(value): |
83 | 88 | raise ValidationError(self.error_messages['checksum']) |
… |
… |
class PLREGONField(RegexField):
|
116 | 121 | |
117 | 122 | def clean(self,value): |
118 | 123 | super(PLREGONField, self).clean(value) |
| 124 | if value in EMPTY_VALUES: |
| 125 | return u'' |
119 | 126 | if not self.has_valid_checksum(value): |
120 | 127 | raise ValidationError(self.error_messages['checksum']) |
121 | 128 | return u'%s' % value |