#1993: [PATCH] @validate recursion guard revisited
----------------------------------------------+-----------------------------
Reporter: aspineux | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.1
Component: TurboGears | Version: 1.0.7
Severity: normal | Resolution:
Keywords: validate, recursion, needs tests |
----------------------------------------------+-----------------------------
Comment (by aspineux):
Replying to [comment:4 Chris Arndt]:
> If we agree that this is a good approach (I'm not sure about it), the
maximum number of calls to validate should be a config setting.
I agree, what about
validate.recursion_limit=15
>
> Also there should be a source code comment that explains what's going
here.
What about :
This is a simple test to avoid recursion. Instead of trying to stop
recursion
by checking function name like in http://trac.turbogears.org/ticket/1396
or simply limiting the number of call into one HTTP request to 1 like in
previous version, it allow limited call to @validate per request.
>
> Finally, if the patch is accepted, this should be documented on
http://docs.turbogears.org/1.0/ValidateDecorator (or the 1.1 equivalent).
in "Beware of the Recursion Guard", I don't know if "1" is still relevant,
but 2 could be replaced by :
2) The number of use of the validate decorator is limited by option
"validate.recursion_limit". Increase the the value if needed by your
application. The default is 15.
Finally, I dont understand the utility of this test. I just provided a
patch because
my app was not working anymore (I was cascading @validate). If the app
allow
@validate recursion, this is a bug in the application design, isn't it ?
And then just raise an exception, not just silently ignore the @validate
!!!
My 2ct.
Alain
--
Ticket URL: <http://trac.turbogears.org/ticket/1993#comment:5>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---