Skip to content

form.pt does not show validation errors from the top node of the schema #54

Closed
groner opened this Issue Oct 13, 2011 · 0 comments

2 participants

@groner
groner commented Oct 13, 2011

The error message generated by the test below isn't rendered.

import deform
import colander


class LoginForm(colander.Schema):
    username = colander.SchemaNode(colander.String())
    password = colander.SchemaNode(colander.String(),
            widget=deform.widget.PasswordWidget())

def validate_password(node, d):
    raise colander.Invalid(node, 'Username does not match password')

loginform = LoginForm(validator=validate_password)

try:
    d = deform.Form(loginform).validate([
        ('__formid__', 'deform'),
        ('username', 'kai'),
        ('password', '123')])
except deform.ValidationFailure, e:
    print e.render()

This snippet appears in .errorLi of mapping.pt but seems to be missing in form.pt.

<p class="errorMsg">${field.errormsg}</p>
@kiorky kiorky added a commit that closed this issue Dec 7, 2011
@kiorky kiorky Add a test for Kai Groner fix.
This fixes #54.
688858e
@kiorky kiorky closed this in 688858e Dec 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.