stormpath / stormpath-flask

Build simple, secure web applications with Stormpath and Flask!
http://flask-stormpath.readthedocs.org/en/latest/
Other
155 stars 31 forks source link

Use standard WTForm validation for 'register' page. #78

Closed jcass77 closed 8 years ago

jcass77 commented 8 years ago

This PR simplifies the /register view so that it makes use of the standard WTForm validation rules.

Why this is necessary:

The way the code is written now, the InputRequired validator is never added to the WTForm field, and validation is done in a non-standard way in views.register. This makes it difficult for users to add their own form validation processing (e.g. using a macro as suggested in the Flask documentation), because field.errors will never be set.

Changes include:

jcass77 commented 8 years ago

I took the liberty of also adding the Email and EqualTo validators, and more appropriate validation error messages for each field.

rdegges commented 8 years ago

This is awesome, thanks so much!