Skip to content
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

Fix TypeError from trying to call a boolean #11

Closed
wants to merge 1 commit into from
Closed

Fix TypeError from trying to call a boolean #11

wants to merge 1 commit into from

Conversation

Diftraku
Copy link

@Diftraku Diftraku commented Dec 5, 2017

user.is_authenticated is a boolean value in Django 2.0, this causes a TypeError when trying to load the page with adminlte2 templates.

Example end of stack trace for loading the admin site:

File "/usr/lib/python3.6/site-packages/django_adminlte/templatetags/adminlte_helpers.py" in avatar_url
  20.         hash=md5(user.email.encode('utf-8')).hexdigest() if user.is_authenticated() else '',

Exception Type: TypeError at /admin/
Exception Value: 'bool' object is not callable

user.is_authenticated is a boolean value in Django 2.0, this causes a TypeError when trying to load the page with adminlte2 templates.
@adamcharnock
Copy link
Owner

Thanks for the PR @Diftraku, it is much appreciated. In the end I added a compat.py file with is_authenticated() which detects the appropriate course of action.

@adamcharnock
Copy link
Owner

I've just released 0.2.2 containing this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants