Validate VAT number only if it is set

This commit is contained in:
PCoder 2019-12-25 22:40:57 +05:30
parent 3b654f1c49
commit b15ece7088

View file

@ -542,6 +542,8 @@ class PaymentOrderView(FormView):
else: else:
request.session['customer'] = customer request.session['customer'] = customer
vat_number = address_form.cleaned_data.get('vat_number').strip()
if vat_number:
validate_result = validate_vat_number( validate_result = validate_vat_number(
stripe_customer_id=request.session['customer'], stripe_customer_id=request.session['customer'],
vat_number=address_form.cleaned_data.get('vat_number') vat_number=address_form.cleaned_data.get('vat_number')