Skip to content

Commit b39c179

Browse files
authored
Merge pull request #6 from skip-pay/tda/chore/django_bump
chore: Django bump to <=5.0
2 parents 2fcac5c + e8a7e80 commit b39c179

File tree

11 files changed

+22
-33
lines changed

11 files changed

+22
-33
lines changed

.github/workflows/django.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ jobs:
1313
max-parallel: 4
1414
matrix:
1515
include:
16-
- python-version: 3.7
17-
django-version: Django==3.1
18-
19-
- python-version: 3.7
20-
django-version: Django==3.2
21-
22-
- python-version: 3.8
23-
django-version: Django==3.1
24-
25-
- python-version: 3.8
26-
django-version: Django==3.2
16+
- python-version: 3.11
17+
django-version: Django==4.2
2718

2819
steps:
2920
- uses: actions/checkout@v2

auth_token/contrib/common/default/views.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ class TokenLogoutView(LogoutView):
6060
@method_decorator(never_cache)
6161
def dispatch(self, request, *args, **kwargs):
6262
logout(request)
63-
next_page = self.get_next_page()
64-
if next_page:
65-
# Redirect to this page until the session has been cleared.
66-
return HttpResponseRedirect(next_page)
67-
return super(LogoutView, self).dispatch(request, *args, **kwargs)
63+
return super().dispatch(request, *args, **kwargs)
6864

6965

7066
class InputLogMixin:

auth_token/contrib/rest_framework_auth/authentication.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ def enforce_csrf(self, request):
3333
"""
3434
Enforce CSRF validation for session based authentication.
3535
"""
36-
reason = CSRFCheck().process_view(request, None, (), {})
36+
37+
def dummy_get_response(_): # pragma: no cover
38+
return None
39+
reason = CSRFCheck(dummy_get_response).process_view(request, None, (), {})
3740
if reason:
3841
# CSRF failed, bail with explicit error message
3942
raise exceptions.PermissionDenied('CSRF Failed: %s' % reason)

auth_token/middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from datetime import timedelta
22
import time
33

4-
from django.utils.encoding import force_text
4+
from django.utils.encoding import force_str
55
from django.utils.functional import SimpleLazyObject
66
from django.utils.http import http_date
77

@@ -47,7 +47,7 @@ def _update_token_and_cookie(self, request, response, max_age, expires):
4747
if expires_at - request.token.expires_at >= timedelta(seconds=settings.EXPIRATION_DELTA):
4848
request.token.change_and_save(expires_at=expires_at, update_only_changed_fields=True)
4949
if settings.COOKIE and request.token.allowed_cookie:
50-
response.set_cookie(settings.COOKIE_NAME, force_text(request.token.secret_key), max_age=max_age,
50+
response.set_cookie(settings.COOKIE_NAME, force_str(request.token.secret_key), max_age=max_age,
5151
expires=expires, httponly=settings.COOKIE_HTTPONLY,
5252
secure=settings.COOKIE_SECURE, domain=settings.COOKIE_DOMAIN)
5353
return response

auth_token/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def hash_key(key, salt=None):
8686
settings.HASH_SALT,
8787
key,
8888
secret='|'.join((salt or '', django_settings.SECRET_KEY)),
89-
algorithm=django_settings.DEFAULT_HASHING_ALGORITHM,
89+
algorithm="sha256",
9090
).hexdigest()
9191

9292

auth_token/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (0, 3, 0)
1+
VERSION = (0, 4, 0)
22

33

44
def get_version():

example/dj/apps/app/tests/is_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.contrib.auth.hashers import make_password
55
from django.test import override_settings
66
from django.utils import timezone
7-
from django.utils.translation import ugettext as _
7+
from django.utils.translation import gettext as _
88
from nose.tools import assert_equal
99

1010
from auth_token.config import settings

example/dj/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
try:
5-
from django.utils.translation import ugettext_lazy as _
5+
from django.utils.translation import gettext_lazy as _
66
except ImportError:
77
def _(val): return val
88

example/dj/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf import settings
2-
from django.conf.urls import url, include
2+
from django.urls import re_path as url, include
33
from django.contrib import admin
44

55
from app.resource import SimpleAPI

example/requirements.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
Django<=3.2
2-
skip-django-germanium==2.3.6.1
3-
skip-django-security-logger==1.6.4
1+
Django~=4.2.0
2+
skip-django-germanium==2.4.0
43
coveralls
54
flake8
6-
skip-django-is-core==2.24.6.1
7-
djangorestframework==3.12.2
5+
skip-django-is-core==2.25.0
6+
djangorestframework==3.14.0
87
freezegun==1.0.0
98
responses==0.22.0

0 commit comments

Comments
 (0)