From 40810d543bd8a5c969bdcceece01ba52ffc1e3af Mon Sep 17 00:00:00 2001 From: "Alexey Evseev @stalk" Date: Sun, 19 Jan 2020 13:04:42 +0700 Subject: [PATCH] Update supported version or django-rest-knox to v4.1.0 [fixes #110] --- README.md | 2 +- RELEASE_NOTES.md | 3 +++ requirements_optional.txt | 2 +- rest_social_auth/serializers.py | 4 ++-- tox.ini | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9739c7b..f30757a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Requirements - social-auth-core (>=3.0, <4.0) - social-auth-app-django (>=3.1, <4.0) - [optional] djangorestframework-simplejwt (>=4.0.0) -- [optional] django-rest-knox (>=3.2.0, <4.0.0) +- [optional] django-rest-knox (>=4.0.0, <5.0.0) Release notes ------------- diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 637b12e..73a0237 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -3,6 +3,9 @@ rest_social_auth release notes master ------ +- Update supported version of django-rest-knox (>=4.0.0, <5.0.0). v4 has breaking changes. + +Issues: #110 v3.0.0 ------ diff --git a/requirements_optional.txt b/requirements_optional.txt index 0adfe29..179b4dd 100644 --- a/requirements_optional.txt +++ b/requirements_optional.txt @@ -1,3 +1,3 @@ -django-rest-knox<4.0.0 +django-rest-knox>=4.0.0,<5.0.0 djangorestframework-simplejwt>=4.0.0 djangorestframework-jwt==1.11.0 diff --git a/rest_social_auth/serializers.py b/rest_social_auth/serializers.py index 93d4a95..d3a06ed 100644 --- a/rest_social_auth/serializers.py +++ b/rest_social_auth/serializers.py @@ -54,8 +54,8 @@ def get_token(self, obj): ) raise - token = AuthToken.objects.create(obj) - return token + token_instance, token_key = AuthToken.objects.create(obj) + return token_key class UserKnoxSerializer(KnoxSerializer, UserSerializer): diff --git a/tox.ini b/tox.ini index ad3aadd..17026f7 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ deps = social-auth-app-django==3.1.0 djangorestframework-jwt djangorestframework_simplejwt - django-rest-knox<4.0.0 + django-rest-knox<5.0.0 django111: Django>=1.11,<1.12 django22: Django>=2.2,<2.3 django30: Django>=3.0,<3.1