title: Wtforms custom validation message ignored
body: <p>I am building a very simple Sign Up form with flask and I wanted to customize the error message for <code>DataRequired</code> and <code>Email</code> validators, however it seems my custom messages are being ignored and the default messages are being printed. Below is my code snippet</p>
  
  <p><strong><em>forms.py</em></strong></p>
  
  <pre><code>class SignUp(FlaskForm):
      username = StringField('Username', validators=[DataRequired(message='Must be filled'), length(min=4, max=10)])
      email = EmailField('Email', validators=[DataRequired(message='Email can\'t be blank'),
                                              Email(message='valid email address required')])
      password = PasswordField('Password', validators=[DataRequired()])
      confirm_password = PasswordField('Confirm Password',
                                       validators=[DataRequired(), EqualTo('password', 'Passwords must match')])
      submit = SubmitField('Register')
  </code></pre>
  
  <p><strong><em>signup.html</em></strong></p>
  
  <pre><code>{% extends "base.html" %}
  {% from "jinja_helpers.html" import render_field %}
  {% from "jinja_helpers.html" import render_button %}
  {% block body %}
      &lt;div class="container mt-4"&gt;
          &lt;form action="" method="POST"&gt;
              {{ form.hidden_tag() }}
              {{ render_field(form.username) }}
              {{ render_field(form.email) }}
              {{ render_field(form.password) }}
              {{ render_field(form.confirm_password) }}
              {{ render_button(form.submit) }}
          &lt;/form&gt;
          &lt;div class="form-row mt-3"&gt;
              &lt;small class="text-muted"&gt;Already have an account ? &lt;a href="{{ url_for('login') }}"&gt;Log In&lt;/a&gt;&lt;/small&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p><strong><em>jinja_helpers.html</em></strong></p>
  
  <pre><code>{% macro render_field(field) %}
      &lt;div class="form-group"&gt;
          {{ field.label(class="form-control-label font-weight-bold text-muted") }}
          {% if field.errors %}
              {{ field(class="form-control is-invalid") }}
              &lt;div class="invalid-feedback"&gt;
                  {% for error in field.errors %}
                      &lt;span&gt;{{ error }}&lt;/span&gt;
                  {% endfor %}
              &lt;/div&gt;
          {% else %}
              {{ field(class="form-control") }}
          {% endif %}
  
  
      &lt;/div&gt;
  {% endmacro %}
  
  
  {%  macro render_button(button) %}
      {{ button(class="btn btn-dark") }}
  {%  endmacro %}
  </code></pre>
  
  <p>On the form when I leave the <code>username</code> or <code>email</code> fields blank, the validation pop up message I get is "Please fill out this field" which is default I guess. I also tried to print <code>form.errors</code> when I leave this fields blank and strangely the <code>errors</code> dictionary is empty.</p>
  
  <p><strong><em>views.py</em></strong></p>
  
  <pre><code>@app.route('/signup', methods=['GET', 'POST'])
  def signup():
      form = SignUp()
      print(f'------{form.errors}')
      if form.validate_on_submit():
          username = form.username.data
          password = form.password.data
          user = User(username, password)
          db.session.add(user)
          db.session.commit()
          flash('Account created successfully !', 'success')
          return redirect(url_for("login"))
      return render_template("signup.html", form=form, title='App-Sign Up')
  </code></pre>
  
  <p>And this is what I get </p>
  
  <pre><code>------{}
  127.0.0.1 - - [25/Jan/2019 19:08:34] "GET /signup HTTP/1.1" 200 -
  127.0.0.1 - - [25/Jan/2019 19:08:34] "GET /static/css/main.css HTTP/1.1" 404 -
  </code></pre>
  
  <p>So why these errors are not being added the <code>errors</code> and why the custom messages are not taking effect.Are these related some how ? </p>