mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-25 10:33:45 +03:00
Change conditional import from allauth.socialaccount
This commit is contained in:
parent
bcd6ab4401
commit
c009bb9975
|
@ -9,19 +9,15 @@ try:
|
||||||
get_username_max_length)
|
get_username_max_length)
|
||||||
from allauth.account.adapter import get_adapter
|
from allauth.account.adapter import get_adapter
|
||||||
from allauth.account.utils import setup_user_email
|
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:
|
except ImportError:
|
||||||
raise ImportError("allauth needs to be added to INSTALLED_APPS.")
|
raise ImportError("allauth needs to be added to INSTALLED_APPS.")
|
||||||
|
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from requests.exceptions import HTTPError
|
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):
|
class SocialAccountSerializer(serializers.ModelSerializer):
|
||||||
"""
|
"""
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -18,7 +18,7 @@ f.close()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-rest-auth',
|
name='django-rest-auth',
|
||||||
version='0.9.2',
|
version='0.9.3',
|
||||||
author='Sumit Chachra',
|
author='Sumit Chachra',
|
||||||
author_email='chachra@tivix.com',
|
author_email='chachra@tivix.com',
|
||||||
url='http://github.com/Tivix/django-rest-auth',
|
url='http://github.com/Tivix/django-rest-auth',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user