diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 2390b05..33d6698 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -15,12 +15,8 @@ from rest_framework import serializers from requests.exceptions import HTTPError # Import is needed only if we are using social login, in which # case the allauth.socialaccount will be declared - if 'allauth.socialaccount' in settings.INSTALLED_APPS: - try: - from allauth.socialaccount.helpers import complete_social_login - except ImportError: - pass + from allauth.socialaccount.helpers import complete_social_login class SocialLoginSerializer(serializers.Serializer): diff --git a/rest_auth/social_serializers.py b/rest_auth/social_serializers.py index 087e6e1..5bd2f0f 100644 --- a/rest_auth/social_serializers.py +++ b/rest_auth/social_serializers.py @@ -1,14 +1,12 @@ +from django.conf import settings from django.http import HttpRequest from rest_framework import serializers from requests.exceptions import HTTPError # Import is needed only if we are using social login, in which # case the allauth.socialaccount will be declared -try: +if 'allauth.socialaccount' in settings.INSTALLED_APPS: from allauth.socialaccount.helpers import complete_social_login -except ImportError: - pass - -from allauth.socialaccount.models import SocialToken + from allauth.socialaccount.models import SocialToken class TwitterLoginSerializer(serializers.Serializer):