From 04d0a48ed132ffc628d2a146dfb9eb879e958e8e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 4 Mar 2016 16:26:06 -0300 Subject: [PATCH] =?UTF-8?q?Ignora=20aus=C3=AAncia=20de=20get=5Fform=20em?= =?UTF-8?q?=20super=20de=20CrispyLayoutFormMixin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crispy_layout_mixin.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crispy_layout_mixin.py b/crispy_layout_mixin.py index 9e30b56e8..0ece800e0 100644 --- a/crispy_layout_mixin.py +++ b/crispy_layout_mixin.py @@ -81,10 +81,15 @@ class CrispyLayoutFormMixin(object): for fieldname, span in row] def get_form(self, form_class=None): - form = super(CrispyLayoutFormMixin, self).get_form(form_class) - form.helper = FormHelper() - form.helper.layout = SaplFormLayout(*self.get_layout()) - return form + try: + 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.layout = SaplFormLayout(*self.get_layout()) + return form @property def list_field_names(self):