mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-15 10:43:15 +00:00
Moved get_form_class out of serve
This commit is contained in:
parent
88a0767cec
commit
f87dac4385
1 changed files with 5 additions and 2 deletions
|
|
@ -143,6 +143,10 @@ class AbstractForm(Page):
|
|||
class Meta:
|
||||
abstract = True
|
||||
|
||||
def get_form_class(self):
|
||||
fb = self.form_builder(self.form_fields.all())
|
||||
return fb.get_form_class()
|
||||
|
||||
def get_form_parameters(self):
|
||||
return {}
|
||||
|
||||
|
|
@ -153,8 +157,7 @@ class AbstractForm(Page):
|
|||
)
|
||||
|
||||
def serve(self, request):
|
||||
fb = self.form_builder(self.form_fields.all())
|
||||
form_class = fb.get_form_class()
|
||||
form_class = self.get_form_class()
|
||||
form_params = self.get_form_parameters()
|
||||
|
||||
if request.method == 'POST':
|
||||
|
|
|
|||
Loading…
Reference in a new issue