From cc963ca1a169506ee46c926fd7e7bc41f0b46780 Mon Sep 17 00:00:00 2001 From: anyone_j Date: Thu, 26 Nov 2015 14:38:25 +0500 Subject: [PATCH] fix import complete_social_login --- rest_auth/registration/serializers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 5f5efd6..90c8ab5 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -5,13 +5,13 @@ 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: - from allauth.socialaccount.helpers import complete_social_login -except ImportError: - raise ImportError('allauth.socialaccount needs to be installed.') -if 'allauth.socialaccount' not in settings.INSTALLED_APPS: - 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 + class SocialLoginSerializer(serializers.Serializer):