Skip to content

Commit

Permalink
Merge branch 'develop' into language-homograph
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Oct 27, 2022
2 parents e6b8ea1 + 068e115 commit 0ee233b
Show file tree
Hide file tree
Showing 133 changed files with 2,721 additions and 1,088 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.8"
cache: 'pip'
- name: Cache dependencies
uses: actions/cache@v3
Expand All @@ -26,6 +26,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- run: python -m pip install -r docs/requirements.txt
- run: python setup.py install
- run: codespell -w *.rst
- run: codespell -w docs
- name: Build docs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -18,6 +18,7 @@ jobs:
django-3.1.txt,
django-3.2.txt,
django-4.0.txt,
django-4.1.txt,
]
os: [
ubuntu-20.04,
Expand Down Expand Up @@ -71,6 +72,7 @@ jobs:
django-3.1.txt,
django-3.2.txt,
django-4.0.txt,
django-4.1.txt,
]
os: [
ubuntu-20.04,
Expand Down Expand Up @@ -123,6 +125,7 @@ jobs:
django-3.1.txt,
django-3.2.txt,
django-4.0.txt,
django-4.1.txt,
]
os: [
ubuntu-20.04,
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
@@ -1,3 +1,12 @@
ci:
autofix_commit_msg: |
ci: auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: 'ci: pre-commit autoupdate'
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
Expand Down
5 changes: 4 additions & 1 deletion .readthedocs.yaml
@@ -1,3 +1,5 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

sphinx:
Expand All @@ -9,7 +11,8 @@ formats:
- pdf

python:
version: 3.7
version: 3.8

install:
- requirements: docs/requirements.txt
system_packages: false
23 changes: 21 additions & 2 deletions CHANGELOG.rst
Expand Up @@ -5,15 +5,34 @@ Changelog
unreleased
==========

* Support for django 4.1
* Allow to partially override ``CMS_CACHE_DURATIONS``
* Add support for tel: and mailto: URIs in Advanced Page Settings redirect field.
* Make javascript dark mode functions available to popups as CMS.API.getColorScheme
and CMS.API.setColorScheme
* Fix bug where switching color scheme affects other settings
* Unlocalize page and node ids when rendering the page tree in the admin (#7175)
* Fixed permission denied error after page create (#6866)
* Improved performance when using CMS_RAW_ID_USERS=True on a Postgres DB with many users

3.11.0 (2022-08-02)
===================

Highlights:
-----------
* Support for django 4
* Dark mode support

* Added dark mode support to css, dark mode settings and toggle button
* Fix publishing of static placeholders outside of CMS pages
* Allow to override the template rendered after a plugin has been saved.
* Revert change to the toolbar sites menu to use ``http`` protocol.
* Fix edit plugin popup width (remove 850px width constraint).
* Fix except block using list instead of tuple. (#7334)
* Added cache ttl extension point.
* Added spell checking to pre-commit and github workflows
* Added cache ttl extension point.
* Added current language to the page cache key (#6607)
* Fix isort line length to by in sync with flake8

3.10.1 (2022-06-28)
===================
Expand Down Expand Up @@ -1486,7 +1505,7 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2

- language namespaces for apphooks (reverse("de:myview"), reverse("en:myview"))
- video plugin switch to https://github.com/FlashJunior/OSFlashVideoPlayer
- frontediting added (cms.middlware.toolbar.ToolbarMiddleware)
- frontediting added (cms.middleware.toolbar.ToolbarMiddleware)
- testsuite works now under sqlite and postgres
- orphaned text embed plugins get now deleted if not referenced in the text anymore
- placeholder templatetag: "theme" attribute removed in favor of "width" (backward incompatible change if theme was used)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Expand Up @@ -34,7 +34,7 @@ Here’s what the pull request process looks like in brief:

To learn more about basic requirements and standards of code contribution, please familiarize yourself with our comprehensive `documentation <https://docs.django-cms.org/en/latest/contributing/code.html#>`_.

django CMS commits follow the `Conventionnal Commits Guideline <http://conventionnalcommits.org/>`_ , please try to follow the Guidelines in your commit messages to ease our review&merge process.
django CMS commits follow the `Conventional Commits Guideline <https://conventionalcommits.org/>`_, please try to follow the Guidelines in your commit messages to ease our review & merge process.


Proposing large feature additions
Expand Down
2 changes: 1 addition & 1 deletion cms/__init__.py
@@ -1,6 +1,6 @@
import django

__version__ = '3.10.1'
__version__ = '3.11.0'

if django.VERSION < (3, 2):
default_app_config = 'cms.apps.CMSConfig'
32 changes: 13 additions & 19 deletions cms/admin/forms.py
Expand Up @@ -17,15 +17,11 @@
from cms.constants import PAGE_TYPES_ID, PUBLISHER_STATE_DIRTY, ROOT_USER_LEVEL
from cms.exceptions import PluginLimitReached
from cms.extensions import extension_pool
from cms.forms.validators import (
validate_overwrite_url, validate_relative_url, validate_url_uniqueness,
)
from cms.forms.widgets import (
AppHookSelect, ApplicationConfigSelect, UserSelectAdminWidget,
)
from cms.forms.validators import validate_overwrite_url, validate_relative_url, validate_url_uniqueness
from cms.forms.widgets import AppHookSelect, ApplicationConfigSelect, UserSelectAdminWidget
from cms.models import (
CMSPlugin, GlobalPagePermission, Page, PagePermission, PageType, PageUser,
PageUserGroup, Placeholder, Title, TreeNode,
CMSPlugin, GlobalPagePermission, Page, PagePermission, PageType, PageUser, PageUserGroup, Placeholder, Title,
TreeNode,
)
from cms.models.permissionmodels import User
from cms.plugin_pool import plugin_pool
Expand All @@ -34,8 +30,7 @@
from cms.utils.conf import get_cms_setting
from cms.utils.i18n import get_language_list, get_language_object
from cms.utils.permissions import (
get_current_user, get_subordinate_groups, get_subordinate_users,
get_user_permission_level,
get_current_user, get_subordinate_groups, get_subordinate_users, get_user_permission_level,
)
from menus.menu_pool import menu_pool

Expand Down Expand Up @@ -72,8 +67,7 @@ def get_page_changed_by_filter_choices():
def get_page_template_filter_choices():
yield ('', _('All'))

for value, name in get_cms_setting('TEMPLATES'):
yield (value, name)
yield from get_cms_setting('TEMPLATES')


def save_permissions(data, obj):
Expand All @@ -96,7 +90,7 @@ def save_permissions(data, obj):
# add permission `key` for model `model`
codename = get_permission_codename(key, model._meta)
permission = Permission.objects.get(content_type=content_type, codename=codename)
field = 'can_%s_%s' % (key, name)
field = f'can_{key}_{name}'

if data.get(field):
permission_accessor.add(permission)
Expand Down Expand Up @@ -148,7 +142,7 @@ def clean_slug(self):

class AddPageForm(BasePageForm):
source = forms.ModelChoiceField(
label=_(u'Page type'),
label=_('Page type'),
queryset=Page.objects.filter(
is_page_type=True,
publisher_is_draft=True,
Expand Down Expand Up @@ -201,7 +195,7 @@ def clean(self):
if parent_node:
slug = data['slug']
parent_path = parent_node.item.get_path(self._language)
path = u'%s/%s' % (parent_path, slug) if parent_path else slug
path = f'{parent_path}/{slug}' if parent_path else slug
else:
path = data['slug']

Expand Down Expand Up @@ -433,7 +427,7 @@ def clean(self):
if page.parent_page:
slug = data['slug']
parent_path = page.parent_page.get_path(self._language)
path = u'%s/%s' % (parent_path, slug) if parent_path else slug
path = f'{parent_path}/{slug}' if parent_path else slug
else:
path = data['slug']

Expand Down Expand Up @@ -958,7 +952,7 @@ def get_filter_items(self):

def run_filters(self, queryset):
for field, value in self.get_filter_items():
query = {'{}__exact'.format(field): value}
query = {f'{field}__exact': value}
queryset = queryset.filter(**query)
return queryset

Expand Down Expand Up @@ -1099,7 +1093,7 @@ class Meta:


class GenericCmsPermissionForm(forms.ModelForm):
"""Generic form for User & Grup permissions in cms
"""Generic form for User & Group permissions in cms
"""
_current_user = None

Expand Down Expand Up @@ -1176,7 +1170,7 @@ def populate_initials(self, obj):
permissions = permission_accessor.filter(content_type=content_type).values_list('codename', flat=True)
for key in ('add', 'change', 'delete'):
codename = get_permission_codename(key, model._meta)
initials['can_%s_%s' % (key, name)] = codename in permissions
initials[f'can_{key}_{name}'] = codename in permissions
return initials

def save(self, commit=True):
Expand Down

0 comments on commit 0ee233b

Please sign in to comment.