File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
from django .http import HttpRequest
2
+ from django .conf import settings
3
+
2
4
from rest_framework import serializers
3
5
from requests .exceptions import HTTPError
4
6
# Import is needed only if we are using social login, in which
5
7
# case the allauth.socialaccount will be declared
6
8
try :
7
- apps .get_app_config ('allauth.socialaccount' )
8
9
from allauth .socialaccount .helpers import complete_social_login
9
- except LookupError :
10
- pass
11
10
except ImportError :
12
- pass
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.' )
13
15
14
16
15
17
class SocialLoginSerializer (serializers .Serializer ):
You can’t perform that action at this time.
0 commit comments