TurboGears / tg2

Python web framework with full-stack layer implemented on top of a microframework core with support for SQL DBMS, MongoDB and Pluggable Applications
http://www.turbogears.org/
Other
806 stars 78 forks source link

make _navigate_tw2form_children() actually navigate children #50

Closed nphilipp closed 10 years ago

nphilipp commented 10 years ago

The generator has to continue after the first yield, not skip over the children. Not doing this may leave tmpl_context.form_errors empty on validation errors.

nphilipp commented 10 years ago

The else: case is somehow an optimization as children that provide a "compound_key" should be leaf children (the one actually providing a form value), while children that don't provide a compound_key are containers which have children. So it shouldn't make much sense to iterate over children of a leaf child.

Ahh that makes sense, in that case I can close this one.

amol- commented 10 years ago

Thanks anyway for submitting the pull request, I greatly appreciate that. For future pull requests just keep in mind to attach a test that is able to reproduce the error, so I can confirm that the pull request fixes the problem and prevent future breakages