File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 15
15
from requests .exceptions import HTTPError
16
16
# Import is needed only if we are using social login, in which
17
17
# case the allauth.socialaccount will be declared
18
-
19
18
if 'allauth.socialaccount' in settings .INSTALLED_APPS :
20
- try :
21
- from allauth .socialaccount .helpers import complete_social_login
22
- except ImportError :
23
- pass
19
+ from allauth .socialaccount .helpers import complete_social_login
24
20
25
21
26
22
class SocialLoginSerializer (serializers .Serializer ):
Original file line number Diff line number Diff line change
1
+ from django .conf import settings
1
2
from django .http import HttpRequest
2
3
from rest_framework import serializers
3
4
from requests .exceptions import HTTPError
4
5
# Import is needed only if we are using social login, in which
5
6
# case the allauth.socialaccount will be declared
6
- try :
7
+ if 'allauth.socialaccount' in settings . INSTALLED_APPS :
7
8
from allauth .socialaccount .helpers import complete_social_login
8
- except ImportError :
9
- pass
10
-
11
- from allauth .socialaccount .models import SocialToken
9
+ from allauth .socialaccount .models import SocialToken
12
10
13
11
14
12
class TwitterLoginSerializer (serializers .Serializer ):
You can’t perform that action at this time.
0 commit comments