Browse Source

Ignora ausência de get_form em super de CrispyLayoutFormMixin

pull/242/head
Marcio Mazza 9 years ago
parent
commit
04d0a48ed1
  1. 5
      crispy_layout_mixin.py

5
crispy_layout_mixin.py

@ -81,7 +81,12 @@ class CrispyLayoutFormMixin(object):
for fieldname, span in row] for fieldname, span in row]
def get_form(self, form_class=None): def get_form(self, form_class=None):
try:
form = super(CrispyLayoutFormMixin, self).get_form(form_class) form = super(CrispyLayoutFormMixin, self).get_form(form_class)
except AttributeError:
# simply return None if there is no get_form on super
pass
else:
form.helper = FormHelper() form.helper = FormHelper()
form.helper.layout = SaplFormLayout(*self.get_layout()) form.helper.layout = SaplFormLayout(*self.get_layout())
return form return form

Loading…
Cancel
Save