Skip to content

get_strategy() got multiple values for keyword argument 'request' #110

@devangmundhra

Description

@devangmundhra

I am still getting this error when using Django + python social auth and using a @strategy decorator for a function:

TypeError: "get_strategy() got multiple values for keyword argument 'request'"

The code I am using is as follows:

@strategy() 
def register_by_access_token(request, backend, *args, **kwargs):
    access_token = kwargs.get('access_token')
    if not access_token:
        raise AuthMissingParameter(backend, 'access_token')
    user = backend.do_auth(access_token)
    if user and user.is_active:
        login(request, user)
    return user

It looks like load_strategy https://github.com/omab/python-social-auth/blob/master/social/apps/django_app/utils.py#L22 has request in its kwargs which gets passed to get_strategy along with the request=None parameter https://github.com/omab/python-social-auth/blob/master/social/strategies/utils.py#L14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions