Skip to content

Commit

Permalink
Merge pull request #29 from beproud/dj41
Browse files Browse the repository at this point in the history
support Python3.11, Django4.1
  • Loading branch information
posbin authored Jan 24, 2023
2 parents c24aed4 + 6760148 commit 858b182
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
django-version: ['2.2', '3.2']
python-version: ['3.8', '3.9', '3.10', '3.11']
django-version: ['3.2', '4.1']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -41,4 +41,4 @@ jobs:
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}
DJANGO: ${{ matrix.django-version }}
4 changes: 4 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ChangeLog
Release 0.42 (Unreleased)
==========================

- Support Django-4.1
- Support Python-3.8, 3.9, 3.10, 3.11
- Drop Django-2.2
- Drop Python-3.6, 3.7


Release 0.41 (2022-01-25)
Expand Down
4 changes: 2 additions & 2 deletions beproud/django/commons/templatetags/string_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from django.utils.encoding import force_str

from .compat import abbrev as abbrev_

Expand All @@ -18,7 +18,7 @@ def cat(value, arg):
"""
Concatenates value with argument
"""
return u"%s%s" % (value, force_text(arg))
return u"%s%s" % (value, force_str(arg))
cat.is_safe=True
cat = stringfilter(cat)
register.filter(cat)
6 changes: 3 additions & 3 deletions beproud/django/commons/views/simple.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# vim:fileencoding=utf-8

import re
from urllib.parse import quote

from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.http import urlquote

__all__ = (
'redirect_to',
Expand All @@ -26,10 +26,10 @@ def redirect_to(request, url, permanent=True, **kwargs):
klass = permanent and HttpResponsePermanentRedirect or HttpResponseRedirect
quoted_kwargs = {}
for k,v in kwargs.items():
quoted_kwargs[k] = urlquote(v)
quoted_kwargs[k] = quote(v, "/")

# Encoded urls confuses python templating. Properly escape the templates.
return klass(urlquote(RE_QUOTE.sub(r"%%\1", url) % quoted_kwargs))
return klass(quote(RE_QUOTE.sub(r"%%\1", url) % quoted_kwargs), "/")
else:
return HttpResponseGone()

Expand Down
1 change: 1 addition & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
'BACKEND': 'django.template.backends.django.DjangoTemplates',
}]
SECRET_KEY = '<key>'
USE_TZ = False
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[tox]
envlist =
py{36,37,38,39,310}-dj{22,32}
py{38,39,310,311}-dj{32,41}

[testenv]
deps =
Expand All @@ -13,18 +13,18 @@ deps =
mock
dj22: Django>=2.2,<3.0
dj32: Django>=3.2,<4.0
dj41: Django>=4.1,<4.2

commands=pytest tests {posargs}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
DJANGO =
2.2: dj22
3.2: dj32
4.1: dj41

0 comments on commit 858b182

Please sign in to comment.