Ticket #11577: plnipfield.patch
File plnipfield.patch, 727 bytes (added by , 15 years ago) |
---|
-
contrib/localflavor/pl/forms.py
78 78 79 79 def clean(self,value): 80 80 super(PLNIPField, self).clean(value) 81 value = re.sub("[-]", "", value) 82 if not self.has_valid_checksum(value): 83 raise ValidationError(self.error_messages['checksum']) 81 if len(value): 82 value2 = re.sub("[-]", "", value) 83 if not self.has_valid_checksum(value2): 84 raise ValidationError(self.error_messages['checksum']) 84 85 return u'%s' % value 85 86 86 87 def has_valid_checksum(self, number):