title: flask: TypeError: 'tuple' object is not callable
body: <p>I am trying to learn flask using an online tutorial and when I trying to register a user with following formpayload data,</p>
  
  <pre><code>csrf_token=ImJkOTlkYmVlMWQ2N2MwZGVmMGQ5MTRkZmZhODBmY2E0NWFiYTY4Y2Ei.DZIZ_w.UTdQ_hkzHXoIFS8oH8D84AMWLF8&amp;username=vector&amp;email=vcks%40xyz.com&amp;password=1234&amp;password2=1234&amp;submit=Register
  </code></pre>
  
  <p>and when I hit submit i get following traceback</p>
  
  <pre><code>  File "/Users/vaibhavchauhan/microblog/app/routes.py", line 51, in register
      if form.validate_on_submit():
    File "/Users/vaibhavchauhan/.pyenv/versions/3.6.2/envs/flasky/lib/python3.6/site-packages/flask_wtf/form.py", line 101, in validate_on_submit
      return self.is_submitted() and self.validate()
    File "/Users/vaibhavchauhan/.pyenv/versions/3.6.2/envs/flasky/lib/python3.6/site-packages/wtforms/form.py", line 310, in validate
      return super(Form, self).validate(extra)
    File "/Users/vaibhavchauhan/.pyenv/versions/3.6.2/envs/flasky/lib/python3.6/site-packages/wtforms/form.py", line 152, in validate
      if not field.validate(self, extra):
    File "/Users/vaibhavchauhan/.pyenv/versions/3.6.2/envs/flasky/lib/python3.6/site-packages/wtforms/fields/core.py", line 204, in validate
      stop_validation = self._run_validation_chain(form, chain)
    File "/Users/vaibhavchauhan/.pyenv/versions/3.6.2/envs/flasky/lib/python3.6/site-packages/wtforms/fields/core.py", line 224, in _run_validation_chain
      validator(form, self)
  TypeError: 'tuple' object is not callable
  
  @app.route('/register', methods=['GET','POST'])
  def register():
      if current_user.is_authenticated:
          return redirect(url_for('index'))
      form = RegistrationForm()
      if form.validate_on_submit():
          user = User(username=form.username.data, email=form.email.data)
          user.set_password(form.password.data)
          db.session.add(user)
          db.session.commit()
          flash('Congratulations, you are now a registered user!')
          return redirect(url_for('login'))
      return render_template('register.html', title='Register', form=form)
  </code></pre>
  
  <p>as requested I am adding code for Registration Form.</p>
  
  <pre><code>class RegistrationForm(FlaskForm):
      username = StringField('Username', validators=[DataRequired()])
      email = StringField('Email', validators=[DataRequired(), Email()])
      password = PasswordField('Password', validators=[DataRequired()])
      password2 = PasswordField(
          'Repeat Password', validators=[(DataRequired(), EqualTo('password'))])
      submit = SubmitField('Register')
  
      def validate_username(self, username):
          user = User.query.filter_by(username=username.data).first()
          if user is not None:
              raise ValidationError('please use diffrent username.')
  
      def validate_email(self, email):
          user = User.query.filter_by(email=email.data).first()
          if user is not None:
              raise ValidationError('please use diffrent email.')
  </code></pre>