Skip to content

Commit c009bb9

Browse files
committed
Change conditional import from allauth.socialaccount
1 parent bcd6ab4 commit c009bb9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

rest_auth/registration/serializers.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@
99
get_username_max_length)
1010
from allauth.account.adapter import get_adapter
1111
from allauth.account.utils import setup_user_email
12+
from allauth.socialaccount.helpers import complete_social_login
13+
from allauth.socialaccount.models import SocialAccount
14+
from allauth.socialaccount.providers.base import AuthProcess
1215
except ImportError:
1316
raise ImportError("allauth needs to be added to INSTALLED_APPS.")
1417

1518
from rest_framework import serializers
1619
from requests.exceptions import HTTPError
1720

18-
# Import is needed only if we are using social login, in which
19-
# case the allauth.socialaccount will be declared
20-
if 'allauth.socialaccount' in settings.INSTALLED_APPS:
21-
from allauth.socialaccount.helpers import complete_social_login
22-
from allauth.socialaccount.models import SocialAccount
23-
from allauth.socialaccount.providers.base import AuthProcess
24-
2521

2622
class SocialAccountSerializer(serializers.ModelSerializer):
2723
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
setup(
2020
name='django-rest-auth',
21-
version='0.9.2',
21+
version='0.9.3',
2222
author='Sumit Chachra',
2323
author_email='[email protected]',
2424
url='http://github.com/Tivix/django-rest-auth',

0 commit comments

Comments
 (0)