Hi folks,

I've been having problems adding error/exception handling to a simple
app generated using "tg-admin quickstart ...". I think I have found the
problem, and it appears to do with the snippet:
    <input py:for="name,value in original_parameters.items()"
      type="hidden" name="${name}" value="${value}"/>
that appears at the bottom of the autogenerated login.kid template...

The steps I followed:
  . create a "dapp" project using "tg-admin quickstart",
  . no identity
  . "index" leads to the blank login page (login.kid)
  . login submit triggers "validateuser"
  . validation for username/password to include:
     . Plain text
     . Non-empty
    implemented via separate error_handler() and
    exception_handler()
  . On successfull login validation, takes user to
    Welcome page

The login page comes up ok initially. All I have to do is click the
"submit" button repeatedly... The 2nd submit onwards, tg_errors starts
to contain a list of all previous errors- without any of them getting
cleared... between submits.

It appears that the submit button and the hidden values (snippet above
from login.kid) cause the effect of two consecutive submits, even tho
the submit button is clicked only once... taking the valiadation
decorator into a downward spiral... The problem goes away, when I
remove the above snippet from login.kid.

I've pasted the code/changes-to-login.kid/steps at:
http://paste.turbogears.org/paste/877

Unsure if this is to be treated as a bug or not, but if someone tries
to gradually add to autogenerated code (say while learnig TG), they
will encounter this problem... May be the autogenerated login.kid
template should not have the above snippet... The problem is difficult
to narrow down as the runtime tracebacks from the kid-engine are quite
cryptic and not very clear as to the cause of the problem...

Thanks to: Ben Sizer, Diez B. Roggisch and Ian Wilson for helping with
narrowing the problem.
/venkat


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to