title: Flask-WTF not validating
body: <p>I made a WTForms for my Flask Website however the it just wont validate. I have made other flask WTForms before and they all seemed to work but this one just wont work</p>
  <p>forms.py</p>
  <pre><code>class UpdateForm(FlaskForm):
      picture = FileField('Update Profile Picture', validators=[FileAllowed(['jpeg', 'jpg', 'png'])])
      username = StringField(&quot;Username&quot;, validators=[], render_kw={&quot;placeholder&quot;: f&quot;Enter username&quot;})
      email = StringField(&quot;Email&quot;, validators=[Email()], render_kw={&quot;placeholder&quot;: &quot;Enter email&quot;})
      submit = SubmitField('Update')
  
      def validate_username(self, username):
          if username.data is not None:
              user = User.query.filter_by(username=username.data).first()
              if user:
                  raise ValidationError('Username is already taken.')
  
      def validate_email(self, email):
          if email.data is not None:
              emailL = User.query.filter_by(email=email.data).first()
              if emailL:
                 raise ValidationError('Email is already taken.')
              else:
                  raise ValidationError('Enter a valid email.')
  </code></pre>
  <p>I have done these methods before but this one is really not working and its not even giving me an error.</p>
  <p>routes.py</p>
  <pre><code>@app.route('/settings/edit-profile', methods=['POST', 'GET'])
  def edit_profile():
      if not current_user.is_authenticated:
          flash('This process requires login.', 'failure')
          return redirect(url_for('login'))
      else:
          form = UpdateForm()
          if request.method == &quot;POST&quot; and form.validate_on_submit():
              print(form.username.data)
              print(form.email.data)
              pfp = url_for('static', filename=f'pfplib/{current_user.pfp}')
              return render_template(&quot;Settings/edit-profile.html&quot;, pfp=pfp, form=form)
          pfp = url_for('static', filename=f'pfplib/{current_user.pfp}')
          return render_template(&quot;Settings/edit-profile.html&quot;, pfp=pfp, form=form)
  </code></pre>
  <p>html file</p>
  <pre><code>&lt;form method=&quot;POST&quot; action=&quot;&quot; enctype=&quot;multipart/form-data&quot;&gt;
              {{ form.csrf_token }}
              {{ form.hidden_tag() }}
              &lt;div class=&quot;main-content&quot;&gt;
                  &lt;div class=&quot;pfp-change&quot;&gt;
                      &lt;div class=&quot;container-pfp&quot;&gt;
                          &lt;img src=&quot;{{ pfp }}&quot;&gt;
                          &lt;div class=&quot;pick-div&quot;&gt;
                              &lt;input type=&quot;file&quot;&gt;
                              &lt;i class=&quot;fa fa-camera&quot; style=&quot;color: #ffffff&quot;&gt;&lt;/i&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;edit-profile-form&quot;&gt;
                      &lt;div class=&quot;username-column&quot;&gt;
                          {{ form.username.label(class=&quot;head-label&quot;) }}
                          {% if form.username.errors %}
                              {{ form.username(class=&quot;string-field&quot;) }}
                              {% print(error) %}
                              &lt;div class=&quot;invalid-feedback&quot;&gt;
                                  &lt;span&gt;{{ error }}&lt;/span&gt;
                              &lt;/div&gt;
                          {% else %}
                              {{ form.username(class=&quot;string-field&quot;, value=current_user.username) }}
                          {% endif %}
                      &lt;/div&gt;
                      &lt;div class=&quot;email-column&quot;&gt;
                          {{ form.email.label(class=&quot;head-label&quot;) }}
                          {{ form.email(class=&quot;string-field&quot;, value=current_user.email) }}
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class=&quot;submit-div&quot;&gt;
                  {{ form.submit(class=&quot;btn-gradient submit-btn-1&quot;) }}
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  <p>Hope someone can help fast
  THANKING u SOOO SOOO SOO MUCH IF you can find a fix</p>