mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Catch general HTTP errors during VAT validation
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
from urllib.error import HTTPError
|
||||||
|
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
import pytz
|
import pytz
|
||||||
@@ -451,7 +452,7 @@ class BaseInvoiceAddressForm(forms.ModelForm):
|
|||||||
'your country is currently not available. We will therefore '
|
'your country is currently not available. We will therefore '
|
||||||
'need to charge VAT on your invoice. You can get the tax amount '
|
'need to charge VAT on your invoice. You can get the tax amount '
|
||||||
'back via the VAT reimbursement process.'))
|
'back via the VAT reimbursement process.'))
|
||||||
except vat_moss.errors.WebServiceError:
|
except (vat_moss.errors.WebServiceError, HTTPError):
|
||||||
logger.exception('VAT ID checking failed for country {}'.format(data.get('country')))
|
logger.exception('VAT ID checking failed for country {}'.format(data.get('country')))
|
||||||
self.instance.vat_id_validated = False
|
self.instance.vat_id_validated = False
|
||||||
if self.request and self.vat_warning:
|
if self.request and self.vat_warning:
|
||||||
|
|||||||
Reference in New Issue
Block a user