You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some backends, for example vk or odnoklassniki provide a function (vk_api and odnoklassniki_api) to make additional API calls. In python-social-auth compared to django-social-auth this function now accepts additional backend param, which should be the backend object.
What is the recommended way of getting this object outside the pipeline so that I could pass it to the function to make additional API calls. Should I just import a class and instantiate it or this object is already stored somewhere inside the user object ?
Thx
The text was updated successfully, but these errors were encountered:
fromsocial.strategies.utilsimportget_current_strategy# given a user instance (could be from request.user)social=user.social_auth.get(provider='vk')
strategy=get_current_strategy()
backend=social.get_backend(strategy)
Thanks, but social.get_backend(strategy) returns a class, and I needed an instance of that class, so I did social.get_backend(strategy)(strategy=strategy) and got back an instance, and now everything works perfectly.
Maybe it is a good idea to create a wrapper for the code above somewhere to ease access to backend instance object, thanks and feel free to close this issue.
Hi,
Some backends, for example vk or odnoklassniki provide a function (vk_api and odnoklassniki_api) to make additional API calls. In python-social-auth compared to django-social-auth this function now accepts additional backend param, which should be the backend object.
What is the recommended way of getting this object outside the pipeline so that I could pass it to the function to make additional API calls. Should I just import a class and instantiate it or this object is already stored somewhere inside the user object ?
Thx
The text was updated successfully, but these errors were encountered: