Skip to content

Commit 7c8a34f

Browse files
committed
Merge pull request #132 from asudoma/master
fix import complete_social_login
2 parents 0041530 + cc963ca commit 7c8a34f

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
@@ -14,13 +14,13 @@
1414
from requests.exceptions import HTTPError
1515
# Import is needed only if we are using social login, in which
1616
# case the allauth.socialaccount will be declared
17-
try:
18-
from allauth.socialaccount.helpers import complete_social_login
19-
except ImportError:
20-
raise ImportError('allauth.socialaccount needs to be installed.')
2117

22-
if 'allauth.socialaccount' not in settings.INSTALLED_APPS:
23-
raise ImportError('allauth.socialaccount needs to be added to INSTALLED_APPS.')
18+
if 'allauth.socialaccount' in settings.INSTALLED_APPS:
19+
try:
20+
from allauth.socialaccount.helpers import complete_social_login
21+
except ImportError:
22+
pass
23+
2424

2525

2626
class SocialLoginSerializer(serializers.Serializer):

0 commit comments

Comments
 (0)