From c009bb997509fed2d7a544d54b25322efbee57d9 Mon Sep 17 00:00:00 2001 From: Maxim Kukhtenkov Date: Sat, 20 Jan 2018 20:01:42 -0500 Subject: [PATCH] Change conditional import from allauth.socialaccount --- rest_auth/registration/serializers.py | 10 +++------- setup.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index a82dc6c..db946b7 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -9,19 +9,15 @@ try: get_username_max_length) from allauth.account.adapter import get_adapter from allauth.account.utils import setup_user_email + from allauth.socialaccount.helpers import complete_social_login + from allauth.socialaccount.models import SocialAccount + from allauth.socialaccount.providers.base import AuthProcess except ImportError: raise ImportError("allauth needs to be added to INSTALLED_APPS.") 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: - from allauth.socialaccount.helpers import complete_social_login - from allauth.socialaccount.models import SocialAccount - from allauth.socialaccount.providers.base import AuthProcess - class SocialAccountSerializer(serializers.ModelSerializer): """ diff --git a/setup.py b/setup.py index b3aa55b..2c9dad4 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ f.close() setup( name='django-rest-auth', - version='0.9.2', + version='0.9.3', author='Sumit Chachra', author_email='chachra@tivix.com', url='http://github.com/Tivix/django-rest-auth',