title: flask TypeError: 'ImmutableMultiDict' object is not callable
body: <p>Can someone say what is wrong with this code? The error which I get:</p>
  <blockquote>
  <p>TypeError: 'ImmutableMultiDict' object is not callable</p>
  </blockquote>
  <pre><code>def login():
  error = None
  form = LoginForm(request.form)
  
  if request.method == 'POST':
      viewer = User.query.filter_by(Group='viewer').first()
      admin = User.query.filter_by(Group='admin').first()
      staff = User.query.filter_by(Group='staff').first()
      user = User.query.filter_by(Email=request.form(['email'])).first()
      password = User.query.filter_by(Password=request.form(['password'])).first()
      if (user or password) is None:
          session['logged_in'] = False
          flash('Please write your username password')
      else:
  
                  session['logged_in'] = True
                  flash('You were logged in')
                  if viewer:
                      return redirect(url_for('viewer'))
                  elif admin :
                      return redirect(url_for('admin'))
                  elif staff:
                      return redirect(url_for('employee'))
  
  return render_template('login.html', form=form)
  </code></pre>
  <p>And this is an html part:</p>
  <pre><code>&lt;form class=&quot;sa-innate-form&quot; method=&quot;post&quot;&gt;
                              {{ form.csrf_token }}
                              &lt;label&gt;Email Address&lt;/label&gt;
                              &lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;{{ request.form.email }}&quot;&gt;
                              &lt;label&gt;Password&lt;/label&gt;
                              &lt;input type=&quot;password&quot; name=&quot;password&quot; value=&quot;{{ request.form.password }}&quot;&gt;
                              &lt;button type=&quot;submit&quot; value=&quot;submit&quot;&gt;Sign In&lt;/button&gt;
                              &lt;a href=&quot;&quot;&gt;Forgot Password?&lt;/a&gt;
                          &lt;/form&gt;
  </code></pre>