Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add support of django 4.0 #203

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
dj30_cms37.txt,
dj30_cms38.txt,
dj31_cms38.txt,
dj40_cms311.txt,
]
os: [
ubuntu-20.04,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
Unreleased
==========

* Added support for Django 4.0
* Display page title instead of menu title


Expand Down
6 changes: 3 additions & 3 deletions djangocms_link/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _

Expand Down Expand Up @@ -216,7 +216,7 @@ def clean(self):
'internal_link',
)

anchor_field_verbose_name = force_text(
anchor_field_verbose_name = force_str(
self._meta.get_field(anchor_field_name).verbose_name)
anchor_field_value = getattr(self, anchor_field_name)

Expand All @@ -225,7 +225,7 @@ def clean(self):
for key in field_names
}
link_field_verbose_names = {
key: force_text(self._meta.get_field(key).verbose_name)
key: force_str(self._meta.get_field(key).verbose_name)
for key in link_fields.keys()
}
provided_link_fields = {
Expand Down
4 changes: 4 additions & 0 deletions tests/requirements/dj40_cms311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r base.txt

Django>=4.0,<4.1
django-cms>=3.11,<4.0