borni-dhifi / vatnumber

Automatically exported from code.google.com/p/vatnumber
GNU General Public License v3.0
0 stars 0 forks source link

check_vat() raises an exception when the given VAT does not start with a country code #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

With the latest revision:

>>> from vatnumber import check_vat
>>> check_vat('12347')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../vatnumber/__init__.py", line 1168, in check_vat
KeyError: 'check_vat_12'

I think that 'check_vat' should not raise any exception and rather return 
"False". The attached patch implements this new behaviour (with an additional 
test).

I understand that the current behaviour may be wanted to indicate that there is 
no VATIN checker for a particular country, but I nonetheless think that this is 
unfortunate.

Original issue reported on code.google.com by damien.b...@gmail.com on 19 Oct 2010 at 1:58

Attachments:

GoogleCodeExporter commented 8 years ago
Looks good.
You can provide a patch by exporting from hg like that you will be the author 
of the changeset.

Original comment by cedric.krier@b2ck.com on 19 Oct 2010 at 2:15

GoogleCodeExporter commented 8 years ago
Here attached is the output of "hg export". I have also made a clone 
(http://code.google.com/r/damienbaty-isssue-10/source/checkout) if it is easier 
for you. (I'll delete it when the issue is closed.)

Original comment by damien.b...@gmail.com on 20 Oct 2010 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago
Applied in rev 3d2935d8dc

Original comment by cedric.krier@b2ck.com on 20 Oct 2010 at 5:26