From 30a914d8ee50f7dbf57ae0804faada1b501f987b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 10 Dec 2017 23:56:38 +0100 Subject: [PATCH] Update for getting form_class --- hosting/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index f6d0f0eb..cfaa07ab 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -538,11 +538,13 @@ class SettingsView(LoginRequiredMixin, FormView): login_url = reverse_lazy('hosting:login') form_class = BillingAddressForm - def get_form(self, form_class): + def get_form(self, form_class=None): """ Check if the user already saved contact details. If so, then show the form populated with those details, to let user change them. """ + if form_class is None: + form_class = self.get_form_class() return form_class( instance=self.request.user.billing_addresses.first(), **self.get_form_kwargs())