Skip to content

Commit

Permalink
fix: django 4.2 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Salman Nawaz authored and Salman Nawaz committed Jul 13, 2023
1 parent 7ae5edb commit 5fea4f4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, docs, django32-drflatest, django40-drflatest]
toxenv: [quality, docs, django32-drflatest, django40-drflatest, django42-drflatest]
steps:
- uses: actions/checkout@v3
- name: setup python
Expand All @@ -36,7 +36,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django32-drflatest'
if: matrix.python-version == '3.8' && matrix.toxenv=='django42-drflatest'
uses: codecov/codecov-action@v3
with:
files: htmlcov/index.html
Expand Down
4 changes: 1 addition & 3 deletions config_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
Configuration models for Django allowing config management with auditing.
"""

__version__ = '2.3.0'

default_app_config = 'config_models.apps.ConfigModelsConfig' # pylint: disable=invalid-name
__version__ = '2.4.0'
4 changes: 3 additions & 1 deletion config_models/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ def add_view(self, request, form_url='', extra_context=None):
# with the value of the latest config, which doesn't make sense for keyed models.
return super(ConfigurationModelAdmin, self).add_view(request, form_url, extra_context)

@admin.display(
description=_('Update')
)
def edit_link(self, inst):
""" Edit link for the change view """
if not inst.is_active:
return '--'
update_url = reverse(f'admin:{self.model._meta.app_label}_{self.model._meta.model_name}_add')
update_url += f"?source={inst.pk}"
return format_html('<a href="{}">{}</a>', update_url, _('Update'))
edit_link.short_description = _('Update')
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def is_requirement(line):
'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 or later (AGPLv3+)',
'Natural Language :: English',
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,40}-drf{latest},quality,docs
envlist = py38-django{32, 42}-drf{latest},quality,docs

[pycodestyle]
exclude = .git,.tox,migrations
Expand All @@ -19,6 +19,7 @@ setenv =
DJANGO_SETTINGS_MODULE = test_settings
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
django40: Django>=4.0,<4.1
drflatest: djangorestframework
-r{toxinidir}/requirements/test.txt
Expand Down Expand Up @@ -58,3 +59,4 @@ commands =
pylint tests
pycodestyle config_models tests
make help

0 comments on commit 5fea4f4

Please sign in to comment.