From 6ac6db8212cd3fa0b3de3bbcfc7c23c03b8ff3e1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 31 Dec 2019 22:52:24 +0530 Subject: [PATCH] Get the last user billing address as the default address --- hosting/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hosting/views.py b/hosting/views.py index 6467c243..bca31df0 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -621,6 +621,7 @@ class SettingsView(LoginRequiredMixin, FormView): form = self.get_form() if form.is_valid(): if 'billing-form' in request.POST: + current_billing_address = self.request.user.billing_addresses.last() billing_address_data = form.cleaned_data billing_address_data.update({ 'user': self.request.user.id