From 366a2edc59bf6d63a4f6541b8d9113e96c206e8e Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 28 Dec 2020 15:12:08 +0100 Subject: [PATCH 1/4] Prevent typing install in Python 3.6+ --- requirements/requirements-base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-base.txt b/requirements/requirements-base.txt index eab8912..82bda96 100644 --- a/requirements/requirements-base.txt +++ b/requirements/requirements-base.txt @@ -1,3 +1,3 @@ Django>=1.10 djangorestframework>=3.3 -typing>=3.7,<3.8 +typing>=3.7,<3.8; python_version<'3.5' From 4c1f166fa7da34b02461e2afe8d5f4680f7a5149 Mon Sep 17 00:00:00 2001 From: Damien Allen Date: Sun, 3 Jan 2021 13:11:34 +0100 Subject: [PATCH 2/4] Apply django import_string helper function --- rest_registration/checks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_registration/checks.py b/rest_registration/checks.py index 62c30b7..7ffb754 100644 --- a/rest_registration/checks.py +++ b/rest_registration/checks.py @@ -6,6 +6,7 @@ from django.core.checks import register from django.core.exceptions import ImproperlyConfigured from django.db.models import Model +from django.utils.module_loading import import_string from rest_framework.settings import api_settings from rest_registration.auth_token_managers import AbstractAuthTokenManager @@ -114,7 +115,7 @@ def _is_auth_token_manager_auth_class_enabled() -> bool: auth_token_manager = _get_auth_token_manager() auth_cls = auth_token_manager.get_authentication_class() return any( - issubclass(cls, auth_cls) + issubclass(import_string(cls), auth_cls) for cls in api_settings.DEFAULT_AUTHENTICATION_CLASSES ) From be99e9f6e35014d0157fbd3fafc0d8ac9ee341a4 Mon Sep 17 00:00:00 2001 From: Damien Allen Date: Sun, 3 Jan 2021 13:57:31 +0100 Subject: [PATCH 3/4] Revert changes --- rest_registration/checks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rest_registration/checks.py b/rest_registration/checks.py index 7ffb754..62c30b7 100644 --- a/rest_registration/checks.py +++ b/rest_registration/checks.py @@ -6,7 +6,6 @@ from django.core.checks import register from django.core.exceptions import ImproperlyConfigured from django.db.models import Model -from django.utils.module_loading import import_string from rest_framework.settings import api_settings from rest_registration.auth_token_managers import AbstractAuthTokenManager @@ -115,7 +114,7 @@ def _is_auth_token_manager_auth_class_enabled() -> bool: auth_token_manager = _get_auth_token_manager() auth_cls = auth_token_manager.get_authentication_class() return any( - issubclass(import_string(cls), auth_cls) + issubclass(cls, auth_cls) for cls in api_settings.DEFAULT_AUTHENTICATION_CLASSES ) From 669f196e5779733df204ec0c1f8647733eda5190 Mon Sep 17 00:00:00 2001 From: Andrzej Pragacz Date: Sat, 9 Jan 2021 01:51:07 +0100 Subject: [PATCH 4/4] Downgrade djangorestframework-stubs below 1.3.0 --- requirements/requirements-linting.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-linting.txt b/requirements/requirements-linting.txt index aa3dda6..5a51b25 100644 --- a/requirements/requirements-linting.txt +++ b/requirements/requirements-linting.txt @@ -6,6 +6,6 @@ flake8-print flake8-tuple isort<5.0 pylint -mypy>=0.770,<0.780 +mypy django-stubs -djangorestframework-stubs +djangorestframework-stubs<1.3.0