We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8c3ae9 commit cc963caCopy full SHA for cc963ca
rest_auth/registration/serializers.py
@@ -5,13 +5,13 @@
5
from requests.exceptions import HTTPError
6
# Import is needed only if we are using social login, in which
7
# 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.')
12
13
-if 'allauth.socialaccount' not in settings.INSTALLED_APPS:
14
- raise ImportError('allauth.socialaccount needs to be added to INSTALLED_APPS.')
+if 'allauth.socialaccount' in settings.INSTALLED_APPS:
+ try:
+ from allauth.socialaccount.helpers import complete_social_login
+ except ImportError:
+ pass
+
15
16
17
class SocialLoginSerializer(serializers.Serializer):
0 commit comments