mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-29 12:23:43 +03:00
Adds check for optional deps in INSTALLED_APPS
Previously the serializers.py file relied solely on the presence of allauth.socialaccount in the PYTHON_PATH to determine if its use was required. This adds another check in the Django INSTALLED_APPS for the allauth.socialaccount app, and then continues with the import if the app has been added.
This commit is contained in:
parent
d25df33a79
commit
0ae97701c8
|
@ -4,7 +4,10 @@ from requests.exceptions import HTTPError
|
||||||
# Import is needed only if we are using social login, in which
|
# Import is needed only if we are using social login, in which
|
||||||
# case the allauth.socialaccount will be declared
|
# case the allauth.socialaccount will be declared
|
||||||
try:
|
try:
|
||||||
|
apps.get_app_config('allauth.socialaccount')
|
||||||
from allauth.socialaccount.helpers import complete_social_login
|
from allauth.socialaccount.helpers import complete_social_login
|
||||||
|
except LookupError:
|
||||||
|
pass
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user