From 4f08e8da0a03cabe08e5d7a547a28b2b17cf08a2 Mon Sep 17 00:00:00 2001 From: Irtaza Akram <51848298+irtazaakram@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:43:00 +0500 Subject: [PATCH] feat: add support for Django 4.2 (#151) --- .github/workflows/ci.yml | 2 +- edx_name_affirmation/__init__.py | 4 +--- edx_name_affirmation/admin.py | 6 ++---- edx_name_affirmation/urls.py | 4 ++-- tox.ini | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25f91e1..c553a83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-20.04] python-version: ["3.8"] node-version: ["10"] - toxenv: [django32, django40, quality, pii_check, rst_validation] + toxenv: [django32, django42, quality, pii_check, rst_validation] steps: - uses: actions/checkout@v1 diff --git a/edx_name_affirmation/__init__.py b/edx_name_affirmation/__init__.py index 60f5cf0..6ad71be 100644 --- a/edx_name_affirmation/__init__.py +++ b/edx_name_affirmation/__init__.py @@ -2,6 +2,4 @@ Django app housing name affirmation logic. """ -__version__ = '2.3.6' - -default_app_config = 'edx_name_affirmation.apps.EdxNameAffirmationConfig' # pylint: disable=invalid-name +__version__ = '2.3.7' diff --git a/edx_name_affirmation/admin.py b/edx_name_affirmation/admin.py index ee1fd8c..1380390 100644 --- a/edx_name_affirmation/admin.py +++ b/edx_name_affirmation/admin.py @@ -7,6 +7,7 @@ from edx_name_affirmation.models import VerifiedName, VerifiedNameConfig +@admin.register(VerifiedName) class VerifiedNameAdmin(admin.ModelAdmin): """ Admin for the VerifiedName Model @@ -20,6 +21,7 @@ class VerifiedNameAdmin(admin.ModelAdmin): raw_id_fields = ('user', ) +@admin.register(VerifiedNameConfig) class VerifiedNameConfigAdmin(admin.ModelAdmin): """ Admin for the VerifiedNameConfig Model @@ -30,7 +32,3 @@ class VerifiedNameConfigAdmin(admin.ModelAdmin): readonly_fields = ('change_date',) search_fields = ('user__username',) raw_id_fields = ('user', ) - - -admin.site.register(VerifiedName, VerifiedNameAdmin) -admin.site.register(VerifiedNameConfig, VerifiedNameConfigAdmin) diff --git a/edx_name_affirmation/urls.py b/edx_name_affirmation/urls.py index 9d43890..78cde9b 100644 --- a/edx_name_affirmation/urls.py +++ b/edx_name_affirmation/urls.py @@ -2,7 +2,7 @@ URLs for edx_name_affirmation. """ -from django.urls import include, path +from django.urls import include, path, re_path from edx_name_affirmation import views @@ -14,7 +14,7 @@ name='verified_name' ), - path( + re_path( r'edx_name_affirmation/v1/verified_name/(?P\d+)$', views.VerifiedNameView.as_view(), name='verified_name_by_id' ), diff --git a/tox.ini b/tox.ini index bf70ef0..c7c1c5f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,40}-celery{53}, quality, rst_validation, docs, pii_check +envlist = py38-django{32,42}-celery{53}, quality, rst_validation, docs, pii_check [doc8] ignore = D001 @@ -36,7 +36,7 @@ norecursedirs = .* docs requirements site-packages [testenv] deps = django32: Django>=3.2,<4.0 - django40: Django>=4.0,<4.1 + django42: Django>=4.2,<5.0 -r{toxinidir}/requirements/test.txt celery44: -r{toxinidir}/requirements/celery44.txt celery50: -r{toxinidir}/requirements/celery50.txt