Hi,

we just stumbled over a peculiar behavior due to the use of Decoration objects 
on actions.

The problem is that in case of validation-errors, execution is delegated to an 
error_handler (which might be the decorated action itself of course). The 
responsible method is _handle_validation_errors

Now the problem is that this call is a simple call that doesn't respect the 
before_call and before_render/after_render hooks:

        if error_handler is None:
            error_handler = controller
            output = error_handler(*remainder, **dict(params))
        elif hasattr(error_handler, 'im_self') and error_handler.im_self != 
controller:
            output = error_handler(*remainder, **dict(params))
        else:
            output = error_handler(controller.im_self, *remainder, 
**dict(params))

My suggestion would be that the hook-handling-code that gets used in the 
normal case is refactored into a method on DecoratedController itself, and 
then used from both normal dispatch, and inside _handle_validation_errors.

If this isn't done that way, we violate expectations of developers.

So the first question: what do others think, do we need this? If the answer is 
yes, read on ;)

I'm personally not yet willing to go to 2.1 alpha. I need a stable 2.0 
version. Howere, the code in question is largely the same in both branches, 
so I'm happy to develop two patches (or maybe one works for both, dunno).

So the second question is: how about this regarding 2.0's maintenance state. 
Is there a bug-fix release 2.0.4 coming, and if yes, would this be considered 
a bug that should be backported? 

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to