title: Flask view raises TypeError: 'bool' object is not callable
body: <p>I am trying to debug a view in my Flask app that is return a 500 status with the error <code>TypeError: 'bool' object is not callable</code> in the traceback. The view calls <code>login_user</code> from Flask-Login then returns <code>True</code> to indicate that the login was successful.</p>
  
  <p>I have debugged until <code>app_iter = app(environ, start_response)</code> and the <code>app</code> is now a boolean with the value <code>True</code> rather than the Flask app object.</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\Python27\lib\site-packages\flask\app.py", line 1836, in __call__
      return self.wsgi_app(environ, start_response)
    File "D:\Python27\lib\site-packages\flask\app.py", line 1820, in wsgi_app
      response = self.make_response(self.handle_exception(e))
    File "D:\Python27\lib\site-packages\flask\app.py", line 1403, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "D:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
      response = self.full_dispatch_request()
    File "D:\Python27\lib\site-packages\flask\app.py", line 1478, in full_dispatch_request
      response = self.make_response(rv)
    File "D:\Python27\lib\site-packages\flask\app.py", line 1577, in make_response
      rv = self.response_class.force_type(rv, request.environ)
    File "D:\Python27\lib\site-packages\werkzeug\wrappers.py", line 824, in force_type
      response = BaseResponse(*_run_wsgi_app(response, environ))
    File "D:\Python27\lib\site-packages\werkzeug\wrappers.py", line 57, in _run_wsgi_app
      return _run_wsgi_app(*args)
    File "D:\Python27\lib\site-packages\werkzeug\test.py", line 854, in run_wsgi_app
      app_iter = app(environ, start_response)
  TypeError: 'bool' object is not callable
  </code></pre>
  
  
  
  <pre><code>@app.route('/login', methods=['POST'])
  def login():
      username = request.form['username']
      user = User.query.filter_by(username=username).first()
  
      if user:
          login_user(user)
          return True
  
      return False
  </code></pre>