Closed OdyX closed 6 years ago
In the context of the https://github.com/defivelo/db project, I have two EAN numbers which validate on https://www.getnewidentity.com/validate-ean.php but are not considered valid by from localflavor.generic.validators.EANValidator:
localflavor.generic.validators.EANValidator
>>> from localflavor.generic.validators import EANValidator >>> v = EANValidator() >>> v('7567554394380') Traceback (most recent call last): File "<console>", line 1, in <module> File "…/env/local/lib/python2.7/site-packages/localflavor/generic/validators.py", line 272, in __call__ raise ValidationError(self.message, code='invalid') ValidationError: [u'Not a valid EAN code.'] >>> >>> v2("756.4334.3999.00") Traceback (most recent call last): File "<console>", line 1, in <module> File "…/env/local/lib/python2.7/site-packages/localflavor/generic/validators.py", line 272, in __call__ raise ValidationError(self.message, code='invalid') ValidationError: [u'Not a valid EAN code.']
These don't work for instance:
756.7554.3943.80
756.4334.3999.00
As mentionned in the pull request, this is an issue about the calculated_checksum which can be 10, which cannot be compared to a single-digit.
calculated_checksum
10
In the context of the https://github.com/defivelo/db project, I have two EAN numbers which validate on https://www.getnewidentity.com/validate-ean.php but are not considered valid by from
localflavor.generic.validators.EANValidator
:These don't work for instance:
756.7554.3943.80
756.4334.3999.00
As mentionned in the pull request, this is an issue about the
calculated_checksum
which can be10
, which cannot be compared to a single-digit.