mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-25 18:43:44 +03:00
fix import complete_social_login
This commit is contained in:
parent
b8c3ae9c68
commit
cc963ca1a1
|
@ -5,13 +5,13 @@ from rest_framework import serializers
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
# Import is needed only if we are using social login, in which
|
# Import is needed only if we are using social login, in which
|
||||||
# case the allauth.socialaccount will be declared
|
# case the allauth.socialaccount will be declared
|
||||||
|
|
||||||
|
if 'allauth.socialaccount' in settings.INSTALLED_APPS:
|
||||||
try:
|
try:
|
||||||
from allauth.socialaccount.helpers import complete_social_login
|
from allauth.socialaccount.helpers import complete_social_login
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError('allauth.socialaccount needs to be installed.')
|
pass
|
||||||
|
|
||||||
if 'allauth.socialaccount' not in settings.INSTALLED_APPS:
|
|
||||||
raise ImportError('allauth.socialaccount needs to be added to INSTALLED_APPS.')
|
|
||||||
|
|
||||||
|
|
||||||
class SocialLoginSerializer(serializers.Serializer):
|
class SocialLoginSerializer(serializers.Serializer):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user