Skip to content

Commit

Permalink
Django 4.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiky30 committed Mar 7, 2024
1 parent 539c0df commit 7daf249
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 92 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ] # latest release minus two
python-version: [ 3.9, 3.10, 3.11, 3.12 ] # latest release minus two
requirements-file: [
dj22_cms40.txt,
dj32_cms40.txt,
django-3.2.txt,
django-4.2.txt,
]
os: [
ubuntu-20.04,
Expand Down
4 changes: 2 additions & 2 deletions djangocms_moderation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from cms.toolbar.utils import get_object_preview_url
from cms.utils.helpers import is_editable_model

from adminsortable2.admin import SortableInlineAdminMixin
from adminsortable2.admin import SortableInlineAdminMixin, SortableAdminBase
from treebeard.admin import TreeAdmin

from . import constants, signals
Expand Down Expand Up @@ -990,7 +990,7 @@ def get_extra(self, request, obj=None, **kwargs):
return 1


class WorkflowAdmin(admin.ModelAdmin):
class WorkflowAdmin(SortableAdminBase, admin.ModelAdmin):
inlines = [WorkflowStepInline]
list_display = ["name", "is_default"]
fields = [
Expand Down
Empty file.
Empty file.
32 changes: 0 additions & 32 deletions djangocms_moderation/contrib/moderation_forms/cms_plugins.py

This file was deleted.

This file was deleted.

Empty file.
10 changes: 0 additions & 10 deletions djangocms_moderation/contrib/moderation_forms/models.py

This file was deleted.

4 changes: 2 additions & 2 deletions djangocms_moderation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.http import is_safe_url
from django.utils.http import url_has_allowed_host_and_scheme
from django.utils.translation import gettext_lazy as _, ngettext
from django.views.generic import FormView

Expand Down Expand Up @@ -83,7 +83,7 @@ def _get_success_redirect(self):
"""
return_to_url = self.request.GET.get("return_to_url")
if return_to_url:
url_is_safe = is_safe_url(
url_is_safe = url_has_allowed_host_and_scheme(
url=return_to_url,
allowed_hosts=self.request.get_host(),
require_https=self.request.is_secure(),
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"django-admin-sortable2>=0.6.4",
]
DEPENDENCY_LINKS = [
"https://github.com/django-cms/django-cms/tarball/release/4.0.1.x#egg=django-cms",
"https://github.com/django-cms/djangocms-versioning/tarball/1.2.2#egg=djangocms-versioning",
"django-cms>=4.1.0",
"djangocms-versioning>=2.0.0",
]

setup(
Expand Down
6 changes: 0 additions & 6 deletions tests/requirements/dj22_cms40.txt

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions tests/requirements/django-4.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-r ./requirements_base.txt

Django>=4.2,<5.0

django-admin-sortable2
django_polymorphic
14 changes: 6 additions & 8 deletions tests/requirements/requirements_base.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
aldryn-forms
cachetools
coverage
django-classy-tags
django-classy-tags>=0.7.2
django-filer
django-sekizai
django-simple-captcha
Expand All @@ -13,9 +12,8 @@ mock
pyflakes>=2.1.1
python-dateutil>=2.4

# Unreleased django-cms 4.0 compatible packages
https://github.com/django-cms/django-cms/tarball/release/4.0.1.x#egg=django-cms
https://github.com/django-cms/djangocms-text-ckeditor/tarball/support/4.0.x#egg=djangocms-text-ckeditor
https://github.com/django-cms/djangocms-versioning/tarball/1.2.2#egg=djangocms-versioning
https://github.com/FidelityInternational/djangocms-version-locking/tarball/1.2.0#egg=djangocms-version-locking
https://github.com/django-cms/djangocms-alias/tarball/support/django-cms-4.0.x#egg=djangocms-alias
# django-cms 4.0 specific packages
django-cms>=4.1.0
djangocms-text-ckeditor>=5.1.2
djangocms-alias>=2.0.0
djangocms-versioning>=2.0.0
6 changes: 2 additions & 4 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"tests.utils.app_1",
"tests.utils.app_2",
"djangocms_versioning",
"djangocms_version_locking",
# the following 4 apps are related
"aldryn_forms",
"filer",
"easy_thumbnails",
"captcha",
Expand All @@ -15,6 +13,7 @@
"tests.utils.moderated_polls",
"tests.utils.versioned_none_moderated_app",
],
"CMS_CONFIRM_VERSION4": True,
# As advised, we can disable migrations in tests. This will improve
# test performance and removes the need for test apps to provide migrations
"MIGRATION_MODULES": {
Expand All @@ -23,10 +22,9 @@
"menus": None,
"djangocms_alias": None,
"djangocms_versioning": None,
"djangocms_version_locking": None,
"filer": None,
"djangocms_moderation": None,
"aldryn_forms": None,
"djangocms_text_ckeditor": None,
},
"DEFAULT_AUTO_FIELD": "django.db.models.AutoField",
}
Expand Down

0 comments on commit 7daf249

Please sign in to comment.