Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
groner opened this Issue · 0 comments

2 participants

Kai Groner Mathieu Le Marec - Pasquet
Kai Groner

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>
Mathieu Le Marec - Pasquet kiorky closed this issue from a commit
Mathieu Le Marec - Pasquet kiorky Add a test for Kai Groner fix.
This fixes #54.
688858e
Mathieu Le Marec - Pasquet kiorky closed this in 688858e
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.