Save VAT number
This commit is contained in:
parent
0f3acf5db4
commit
5e97d70a5e
2 changed files with 8 additions and 0 deletions
|
@ -942,6 +942,11 @@ class OrderConfirmationView(DetailView, FormView):
|
|||
'user': custom_user.id
|
||||
})
|
||||
|
||||
# Customer is created, we save his VAT Number
|
||||
custom_user.vat_number = request.session.get(
|
||||
'billing_address_data').get("vat_number")
|
||||
custom_user.save()
|
||||
|
||||
if 'generic_payment_type' in request.session:
|
||||
stripe_cus = StripeCustomer.objects.filter(
|
||||
stripe_id=stripe_api_cus_id
|
||||
|
|
|
@ -616,6 +616,9 @@ class SettingsView(LoginRequiredMixin, FormView):
|
|||
instance=self.request.user.billing_addresses.first(),
|
||||
data=billing_address_data)
|
||||
billing_address_user_form.save()
|
||||
self.request.user.vat_number = billing_address_data.get(
|
||||
"vat_number")
|
||||
self.request.user.save()
|
||||
msg = _("Billing address updated successfully")
|
||||
messages.add_message(request, messages.SUCCESS, msg)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue