Test code before extracting the country

This commit is contained in:
C?dric Krier 2018-03-09 12:47:08 +01:00
parent 170ed00c68
commit 3e28138b70

View file

@ -20,7 +20,9 @@ class Party:
if self.include_347:
return True
for identifier in self.identifiers:
if identifier.type == 'eu_vat' and identifier.code[:2] == 'ES':
if (identifier.type == 'eu_vat'
and identifier.code
and identifier.code[:2] == 'ES'):
return True
return False