django - DefaultAccountAdapter and DefaultSocialAccountAdapter? -


i tried following specific different signup flows users sign via social accounts (facebook) , sign via traditional login.

from django.conf import settings allauth.account.adapter import defaultaccountadapter allauth.socialaccount.adapter import defaultsocialaccountadapter class normaladapter(defaultsocialaccountadapter):      def get_login_redirect_url(self, request):         if request.user.last_login == request.user.date_joined:             return 'survey/'         else:             return '/results/'  class corporateadapter(defaultaccountadapter):      def get_login_redirect_url(self, request):         if request.user.last_login == request.user.date_joined:             return 'corporate/survey/'         else:             return 'corporate/results/' 

but if log in facebook, calls defaultaccountadapter's get_login_redirect_url instead of defaultsocialaccountadapter's.

point auth plugin correct adapter classes! add following settings django app:

# project/settings.py: account_adapter = 'python.path.to.your.corporateadapter'  socialaccount_adapter ='python.path.to.your.normaladapter' 

then save , reload app (if on apache, restart apache)


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -