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

invalid templatetag 'oneall' #15

Closed
ckot opened this issue Apr 30, 2016 · 2 comments
Closed

invalid templatetag 'oneall' #15

ckot opened this issue Apr 30, 2016 · 2 comments
Labels

Comments

@ckot
Copy link
Contributor

ckot commented Apr 30, 2016

EDIT:
python 2.7.6
Django 1.8.12
django-oneall 1.1.2

I believe the culprit is an import error:

django_oneall/templatetags/oneall.py

from ..models import User, SocialUserCache 

and User is not defined in models.py

I remedied this by adding:

from django.contrib.auth import get_user_model

and then adding the call to get_user_model() in oneall_social_login() as so:

@register.inclusion_tag('oneall/social_login.html')
def oneall_social_login(user=None, **kwargs):
    """
    This tag displays the Social Login or Social Link widget.

    Don't forget to include ``{% oneall_header %}``!

    :param user: Logged in user for Social Link mode; if not provided, it's Social Login mode.
    :param kwargs: Widget options as documented by OneAll. For example, ``grid_sizes=[8,5]``
    """
    User = get_user_model()
    if isinstance(user, User):
@ckot ckot changed the title oneall templatetag won't load invalid templatetag 'oneall' Apr 30, 2016
@ckot
Copy link
Contributor Author

ckot commented May 2, 2016

I've added PR #17 which fixes this

@Liz4v
Copy link
Contributor

Liz4v commented May 5, 2016

Version 1.2 published to PyPI includes this fix.

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

No branches or pull requests

2 participants