Just add, this issue is at more fundamental basis, ie. Python's specific 
handling with *AttributeError* exception and conflicting situation when a 
property and *__getattr__* method are defined.
Not yet found a satisfying solution, maybe remove *FormsetForm.__getattr_* 
entirely and replace with individual properties.
As *django.forms.BaseForm* defines *errors* property and 
*cartridge.shop.forms.OrderForm* derives from it, there is probably no 
other way how to avoid exception loss.

On Sunday, August 23, 2015 at 8:12:22 PM UTC+2, David Unric wrote:
>
> Hello,
>
> bitten recently by a nasty bug in cartridge.shop.forms.OrderForm subclass, 
> hiding  behind strange exceptions propagation in Cartridge.
>
> By an unknown reason, exception raised in OrderForm methods is silenced, 
> ie. code after exception is not run without being noticed. You may test it 
> yourself, just modify the .clean method like bellow:
>
> class OrderForm(FormsetForm, DiscountForm):
>
>
>     def clean(self):        """        Raise ``ValidationError`` if any 
> errors have been assigned        externally, via one of the custom checkout 
> step handlers.        """
>         raise AttributeError('This should not pass !!')
>         # code bellow won't run, exception is not propagated
>         if self._checkout_errors:            raise 
> forms.ValidationError(self._checkout_errors)        return super(OrderForm, 
> self).clean()
>
>
>
> https://bitbucket.org/stephenmcd/cartridge/src/47c89ce915559d7e4d3bc264824a1a617b14ee98/cartridge/shop/forms.py?at=default#forms.py-424
>
> Do I miss something here, is this a documented behavior ?
>
> I can't yet see anything from in OrderForm ancestors. Mezzanine.pages 
> forms do not silence AttributeError, it seems to be specific for Cartridge 
> project.
> Is this a work of some middleware ?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to