From 6b2da1f152942240c07a5abdfbc5bb54fe091c15 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 6 Apr 2021 14:48:29 +0200 Subject: [PATCH 1/2] Add support for Django 3.2 --- .github/workflows/test.yml | 2 +- CHANGES.rst | 2 ++ axes/handlers/cache.py | 6 ++++-- pyproject.toml | 4 +++- setup.py | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 858aab5..0ca1c56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy3'] - django-version: ['2.2', '3.0', '3.1'] + django-version: ['2.2', '3.0', '3.1', '3.2'] # Tox configuration for QA environment include: - python-version: '3.8' diff --git a/CHANGES.rst b/CHANGES.rst index d2fc4b5..5406afa 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ WIP - Improve message formatting for lockout message and translations. [ashokdelphia] +- Add support for Django 3.2 + [hramezani] 5.13.1 (2021-02-22) diff --git a/axes/handlers/cache.py b/axes/handlers/cache.py index 06da63c..b5bf6fc 100644 --- a/axes/handlers/cache.py +++ b/axes/handlers/cache.py @@ -11,7 +11,7 @@ from axes.helpers import ( get_credentials, get_failure_limit, ) -from axes.models import AccessBase +from axes.models import AccessAttempt from axes.signals import user_locked_out log = getLogger(__name__) @@ -44,7 +44,9 @@ class AxesCacheHandler(AbstractAxesHandler, AxesBaseHandler): ) cache_keys.extend( - get_client_cache_key(AccessBase(username=username, ip_address=ip_address)) + get_client_cache_key( + AccessAttempt(username=username, ip_address=ip_address) + ) ) for cache_key in cache_keys: diff --git a/pyproject.toml b/pyproject.toml index ce9139a..359cb8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ DJANGO_SETTINGS_MODULE = "tests.settings" legacy_tox_ini = """ [tox] envlist = - py{36,37,38,39,py3}-dj{22,30,31} + py{36,37,38,39,py3}-dj{22,30,31,32} py{38,39}-djmain py38-djqa @@ -27,6 +27,7 @@ DJANGO = 2.2: dj22 3.0: dj30 3.1: dj31 + 3.2: dj32 main: djmain qa: djqa @@ -37,6 +38,7 @@ deps = dj22: django>=2.2,<2.3 dj30: django>=3.0,<3.1 dj31: django>=3.1,<3.2 + dj32: django>=3.2,<4.0 djmain: https://github.com/django/django/archive/main.tar.gz usedevelop = true commands = pytest diff --git a/setup.py b/setup.py index 9b39c15..7a9e460 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ setup( "Framework :: Django :: 2.2", "Framework :: Django :: 3.0", "Framework :: Django :: 3.1", + "Framework :: Django :: 3.2", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", From 80287bb10a7d4c4375e218d8101805eaa3a5a9ae Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 6 Apr 2021 14:49:00 +0200 Subject: [PATCH 2/2] Fix comment typo in github action test pipeline. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ca1c56..f65230a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: include: - python-version: '3.8' django-version: 'qa' - # Django >= 3.2 only supports >= Python 3.8 + # Django > 3.2 only supports >= Python 3.8 - python-version: '3.8' django-version: 'main' experimental: true