Skip to content

Commit

Permalink
Change conditional import from allauth.socialaccount
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-kht committed Jan 21, 2018
1 parent bcd6ab4 commit c009bb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions rest_auth/registration/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@
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):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='django-rest-auth',
version='0.9.2',
version='0.9.3',
author='Sumit Chachra',
author_email='[email protected]',
url='http://github.com/Tivix/django-rest-auth',
Expand Down

0 comments on commit c009bb9

Please sign in to comment.