From 494b9c058cdc17a534d203f6644e23a3d8f2cc5c Mon Sep 17 00:00:00 2001 From: salmannawaz Date: Thu, 20 Jul 2023 12:35:41 +0500 Subject: [PATCH] Django upgrade 4.2 (#318) * fix: django 4.2 upgrade --------- Co-authored-by: Salman Nawaz --- .github/workflows/ci.yml | 4 ++-- organizations/__init__.py | 2 +- organizations/admin.py | 9 ++++++--- setup.py | 1 + tox.ini | 5 +++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 748542cf..80202215 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: ['3.8'] - toxenv: [django32, django40, quality] + toxenv: [django32, django40, django42, quality] steps: - uses: actions/checkout@v2 @@ -36,7 +36,7 @@ jobs: run: tox - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='django32' + if: matrix.python-version == '3.8' && matrix.toxenv=='django42' uses: codecov/codecov-action@v1 with: flags: unittests diff --git a/organizations/__init__.py b/organizations/__init__.py index 022ffcc1..adef9ef6 100644 --- a/organizations/__init__.py +++ b/organizations/__init__.py @@ -1,4 +1,4 @@ """ edx-organizations app initialization module """ -__version__ = '6.11.1' # pragma: no cover +__version__ = '6.12.0' # pragma: no cover diff --git a/organizations/admin.py b/organizations/admin.py index 5d8edb66..c36612ac 100644 --- a/organizations/admin.py +++ b/organizations/admin.py @@ -27,6 +27,9 @@ def get_actions(self, request): return actions + @admin.action( + description=_('Activate selected entries') + ) def activate_selected(self, request, queryset): """ Activate the selected entries. """ count = queryset.count() @@ -41,6 +44,9 @@ def activate_selected(self, request, queryset): self.message_user(request, message) self.message_user(request, self.HISTORY_DISCLAIMER, level=messages.WARNING) + @admin.action( + description=_('Deactivate selected entries') + ) def deactivate_selected(self, request, queryset): """ Deactivate the selected entries. """ count = queryset.count() @@ -55,9 +61,6 @@ def deactivate_selected(self, request, queryset): self.message_user(request, message) self.message_user(request, self.HISTORY_DISCLAIMER, level=messages.WARNING) - deactivate_selected.short_description = _('Deactivate selected entries') - activate_selected.short_description = _('Activate selected entries') - @admin.register(Organization) class OrganizationAdmin(ActivateDeactivateAdminMixin, admin.ModelAdmin): diff --git a/setup.py b/setup.py index fd74eb73..841c891e 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ def get_version(*file_paths): 'Framework :: Django', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', diff --git a/tox.ini b/tox.ini index 0d9b3917..3992ee9c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,40}, quality +envlist = py38-django{32,40,42}, quality [testenv] setenv = @@ -8,13 +8,14 @@ setenv = deps = django32: Django>=3.2,<4.0 django40: Django>=4.0,<4.1 + django42: Django>=4.2,<4.3 -rtest-requirements.txt commands = python -Wd -m pytest {posargs} coverage report [testenv:quality] -setenv = +setenv = PYTHONPATH = {toxinidir} deps = Django>=3.2,<4.0