New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: 'bool' object is not callable" raised when visiting site #7

Closed
toolness opened this Issue Sep 12, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@toolness
Copy link
Contributor

toolness commented Sep 12, 2015

The following error occurs when visiting the site's homepage:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/noi/app/views.py", line 30, in main_page
    if current_user.is_authenticated():
TypeError: 'bool' object is not callable

Looking at the documentation for flask-login, it seems that the latest version has is_authenticated as a dynamic property rather than a method. I'm not sure if this error is occurring because I have a later version of the library than the code expects.

Removing the trailing () makes things work for first-party code, but there appears to be some third-party code that thinks is_authenticated is a method.

According to flask-login releases, it appears a new version 0.3.0 was just released 2 days ago, so I'm wondering if whatever dependency is requiring flask-login (as it doesn't appear to be in our requirements.txt) simply isn't clamping down on the version number tightly enough.

@talos

This comment has been minimized.

Copy link
Contributor

talos commented Sep 14, 2015

You are correct! The new flask-login broke those method calls. I think we should just clamp our requirements.txt to the older version for now, until we can confirm it breaks nothing else.

toolness added a commit to toolness/noi2 that referenced this issue Sep 14, 2015

@talos talos closed this in #8 Sep 15, 2015

bolkedebruin added a commit to bolkedebruin/airflow that referenced this issue Oct 23, 2015

bolkedebruin added a commit to bolkedebruin/airflow that referenced this issue Oct 23, 2015

damyanbogoev added a commit to damyanbogoev/flask-bookshelf that referenced this issue Nov 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment