Skip to content

Commit cc963ca

Browse files
committed
fix import complete_social_login
1 parent b8c3ae9 commit cc963ca

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rest_auth/registration/serializers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from requests.exceptions import HTTPError
66
# Import is needed only if we are using social login, in which
77
# case the allauth.socialaccount will be declared
8-
try:
9-
from allauth.socialaccount.helpers import complete_social_login
10-
except ImportError:
11-
raise ImportError('allauth.socialaccount needs to be installed.')
128

13-
if 'allauth.socialaccount' not in settings.INSTALLED_APPS:
14-
raise ImportError('allauth.socialaccount needs to be added to INSTALLED_APPS.')
9+
if 'allauth.socialaccount' in settings.INSTALLED_APPS:
10+
try:
11+
from allauth.socialaccount.helpers import complete_social_login
12+
except ImportError:
13+
pass
14+
1515

1616

1717
class SocialLoginSerializer(serializers.Serializer):

0 commit comments

Comments
 (0)