Check if vat_validation_status is in session

This commit is contained in:
PCoder 2019-12-25 22:45:55 +05:30
parent b15ece7088
commit 4491a52bd9

View file

@ -640,7 +640,8 @@ class OrderConfirmationView(DetailView, FormView):
) )
vm_specs["price"] = price vm_specs["price"] = price
if request.session["vat_validation_status"] == "verified": if ("vat_validation_status" in request.session and
request.session["vat_validation_status"] == "verified"):
vm_specs["vat_percent"] = 0 vm_specs["vat_percent"] = 0
vm_specs["vat"] = 0 vm_specs["vat"] = 0
vm_specs["total_price"] = price vm_specs["total_price"] = price
@ -649,7 +650,7 @@ class OrderConfirmationView(DetailView, FormView):
vm_specs["vat"] = vat vm_specs["vat"] = vat
vm_specs["vat_percent"] = vat_percent vm_specs["vat_percent"] = vat_percent
vm_specs["total_price"] = round(price + vat - discount['amount'], 2) vm_specs["total_price"] = round(price + vat - discount['amount'], 2)
vm_specs["vat_validation_status"] = request.session["vat_validation_status"] vm_specs["vat_validation_status"] = request.session["vat_validation_status"] if "vat_validation_status" in request.session else ""
vm_specs["vat_country"] = user_vat_country vm_specs["vat_country"] = user_vat_country
vm_specs["discount"] = discount vm_specs["discount"] = discount