8000 Merge pull request #7525 from fsbraun/develop · django-cms/django-cms@11150c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11150c9

Browse files
authored
Merge pull request #7525 from fsbraun/develop
build: Prepare v3.11.2 by merging develop into release/3.11.x
2 parents 7aaddd4 + 41da65d commit 11150c9
  • static/cms
  • templates/admin/cms/page/tree
  • templatetags
  • test_utils/project
  • tests
  • toolbar
  • utils
  • wizards
  • docs
  • scripts
  • test_requirements
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    101 files changed

    +763
    -348
    lines changed

    .github/workflows/codeql.yml

    Lines changed: 42 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,42 @@
    1+
    name: "CodeQL"
    2+
    3+
    on:
    4+
    push:
    5+
    branches: [ "develop", "develop-4", "release/0.10.x", "release/2.1.x", "release/2.2.x", "release/2.3.x", "release/2.4.x", "release/3.0.x", "release/3.1.x", "release/3.2.x", "release/3.3.x", "release/3.4.x", "release/3.5.x", "release/3.6.x", "release/3.7.x", "release/3.8.x", "release/3.9.x", "release/3.10.x", "release/3.11.x", "release/4.0.x", "release/4.0.0.x", "release/4.0.1.x", "release/4.1.x" ]
    6+
    pull_request:
    7+
    branches: [ "develop" ]
    8+
    schedule:
    9+
    - cron: "40 4 * * 6"
    10+
    11+
    jobs:
    12+
    analyze:
    13+
    name: Analyze
    14+
    runs-on: ubuntu-latest
    15+
    permissions:
    16+
    actions: read
    17+
    contents: read
    18+
    security-events: write
    19+
    20+
    strategy:
    21+
    fail-fast: false
    22+
    matrix:
    23+
    language: [ python, javascript ]
    24+
    25+
    steps:
    26+
    - name: Checkout
    27+
    uses: actions/checkout@v3
    28+
    29+
    - name: Initialize CodeQL
    30+
    uses: github/codeql-action/init@v2
    31+
    with:
    32+
    languages: ${{ matrix.language }}
    33+
    queries: +security-and-quality
    34+
    35+
    - name: Autobuild
    36+
    uses: github/codeql-action/autobuild@v2
    37+
    if: ${{ matrix.language == 'python' || matrix.language == 'javascript' }}
    38+
    39+
    - name: Perform CodeQL Analysis
    40+
    uses: github/codeql-action/analyze@v2
    41+
    with:
    42+
    category: "/language:${{ matrix.language }}"

    .github/workflows/linters.yml

    Lines changed: 10 additions & 27 deletions
    Original file line numberDiff line numberDiff line change
    @@ -6,38 +6,21 @@ concurrency:
    66
    group: ${{ github.workflow }}-${{ github.ref }}
    77
    cancel-in-progress: true
    88

    9-
    jobs:
    10-
    flake8:
    11-
    name: flake8
    12-
    runs-on: ubuntu-latest
    13-
    steps:
    14-
    - name: Checkout
    15-
    uses: actions/checkout@v3
    16-
    - name: Set up Python
    17-
    uses: actions/setup-python@v3
    18-
    with:
    19-
    python-version: "3.10"
    20-
    cache: 'pip'
    21-
    - run: pip install --upgrade flake8
    22-
    - name: flake8
    23-
    uses: liskin/gh-problem-matcher-wrap@v1
    24-
    with:
    25-
    linters: flake8
    26-
    run: flake8
    279

    28-
    isort:
    10+
    jobs:
    11+
    ruff:
    12+
    name: ruff
    2913
    runs-on: ubuntu-latest
    3014
    steps:
    3115
    - name: Checkout
    3216
    uses: actions/checkout@v3
    3317
    - name: Set up Python
    34-
    uses: actions/setup-python@v3
    18+
    uses: actions/setup-python@v4
    3519
    with:
    36-
    python-version: "3.10"
    20+
    python-version: "3.11"
    3721
    cache: 'pip'
    38-
    - run: python -m pip install isort
    39-
    - name: isort
    40-
    uses: liskin/gh-problem-matcher-wrap@v1
    41-
    with:
    42-
    linters: isort
    43-
    run: isort --check --diff cms
    22+
    - run: |
    23+
    python -m pip install --upgrade pip
    24+
    pip install ruff
    25+
    - name: Run Ruff
    26+
    run: ruff cms

    .github/workflows/make-release.yml

    Lines changed: 27 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,27 @@
    1+
    name: Create a django CMS release
    2+
    3+
    on:
    4+
    workflow_dispatch:
    5+
    inputs:
    6+
    version:
    7+
    description: 'Version number to create, e.g., "3.11.1rc1"'
    8+
    required: true
    9+
    type: string
    10+
    branches:
    11+
    - 'develop*'
    12+
    - 'release/**'
    13+
    14+
    jobs:
    15+
    make-release:
    16+
    if: github.actor == 'marksweb' || github.actor == 'fsbraun'
    17+
    runs-on: ubuntu-latest
    18+
    steps:
    19+
    - name: Check out
    20+
    uses: actions/checkout@v3
    21+
    - name: Set up Python ${{ matrix.python-version }}
    22+
    uses: actions/setup-python@v3
    23+
    - name: Start building version ${{ inputs.version }}
    24+
    env:
    25+
    BUILD_BRANCH: release/build
    26+
    TX_TOKEN: ${{ secrets.TX_TOKEN }}
    27+
    run: ./scripts/make-release ${{ inputs.version }} ${GITHUB_REF}

    .github/workflows/test.yml

    Lines changed: 5 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -19,6 +19,7 @@ jobs:
    1919
    django-3.2.txt,
    2020
    django-4.0.txt,
    2121
    django-4.1.txt,
    22+
    django-4.2.txt,
    2223
    ]
    2324
    os: [
    2425
    ubuntu-20.04,
    @@ -73,14 +74,15 @@ jobs:
    7374
    django-3.2.txt,
    7475
    django-4.0.txt,
    7576
    django-4.1.txt,
    77+
    django-4.2.txt,
    7678
    ]
    7779
    os: [
    7880
    ubuntu-20.04,
    7981
    ]
    8082

    8183
    services:
    8284
    mysql:
    83-
    image: mysql:5.7
    85+
    image: mysql:8.0
    8486
    env:
    8587
    MYSQL_ALLOW_EMPTY_PASSWORD: yes
    8688
    MYSQL_DATABASE: djangocms_te F438 st
    @@ -93,6 +95,7 @@ jobs:
    9395
    - uses: actions/checkout@v3
    9496
    - name: Set up Python ${{ matrix.python-version }}
    9597

    98+
    9699
    uses: actions/setup-python@v3
    97100
    with:
    98101
    python-version: ${{ matrix.python-version }}
    @@ -126,6 +129,7 @@ jobs:
    126129
    django-3.2.txt,
    127130
    django-4.0.txt,
    128131
    django-4.1.txt,
    132+
    django-4.2.txt,
    129133
    ]
    130134
    os: [
    131135
    ubuntu-20.04,

    .tx/config

    Lines changed: 6 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,12 +1,13 @@
    11
    [main]
    22
    host = https://www.transifex.com
    33

    4-
    [django-cms.js]
    4+
    [o:divio:p:django-cms:r:core]
    5+
    file_filter = cms/locale/<lang>/LC_MESSAGES/django.po
    6+
    source_file = cms/locale/en/LC_MESSAGES/django.po
    7+
    source_lang = en
    8+
    9+
    [o:divio:p:django-cms:r:js]
    510
    file_filter = cms/locale/<lang>/LC_MESSAGES/djangojs.po
    611
    source_file = cms/locale/en/LC_MESSAGES/djangojs.po
    712
    source_lang = en
    813

    9-
    [django-cms.core]
    10-
    file_filter = cms/locale/<lang>/LC_MESSAGES/django.po
    11-
    source_file = cms/locale/en/LC_MESSAGES/django.po
    12-
    source_lang = en

    CHANGELOG.rst

    Lines changed: 4 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -83,7 +83,9 @@ Highlights:
    8383
    * Support for django 4
    8484
    * Dark mode support
    8585

    86-
    * Added dark mode support to css, dark mode settings and toggle button
    86+
    Bug fixes:
    87+
    ----------
    88+
    8789
    * Fix publishing of static placeholders outside of CMS pages
    8890
    * Allow to override the template rendered after a plugin has been saved.
    8991
    * Revert change to the toolbar sites menu to use ``http`` protocol.
    @@ -1250,7 +1252,7 @@ Thanks to all contributors for their efforts!
    12501252
    - Fix issue on django >= 1.6 with page form fields.
    12511253
    - Resolve jQuery namespace issues in admin page tree and changeform
    12521254
    - Fix issues for PageField in Firefox/Safari
    1253-
    - Fix some Python 3.4 compatibility issue when using proxy modles
    1255+
    - Fix some Python 3.4 compatibility issue when using proxy models
    12541256
    - Fix corner case in plugin copy
    12551257
    - Documentation fixes
    12561258
    - Minor code cleanups

    README.rst

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,9 @@
    11
    ##########
    22
    django CMS
    33
    ##########
    4+
    .. image:: https://static.pepy.tech/badge/django-cms
    5+
    :target: https://pepy.tech/project/django-cms
    6+
    :alt: Downloads
    47
    .. image:: https://travis-ci.org/django-cms/django-cms.svg?branch=develop
    58
    :target: https://travis-ci.org/django-cms/django-cms
    69
    .. image:: https://img.shields.io/pypi/v/django-cms.svg

    cms/admin/__init__.py

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -3,6 +3,7 @@
    33
    import cms.admin.settingsadmin
    44
    import cms.admin.static_placeholder # nopyflakes
    55
    import cms.admin.useradmin
    6+
    67
    # Piggyback off admin.autodiscover() to discover cms plugins
    78
    from cms import plugin_pool
    89

    cms/admin/forms.py

    Lines changed: 18 additions & 6 deletions
    Original file line numberDiff line numberDiff line change
    @@ -9,7 +9,8 @@
    99
    from django.forms.widgets import HiddenInput
    1010
    from django.template.defaultfilters import slugify
    1111
    from django.utils.encoding import force_str
    12-
    from django.utils.translation import gettext, gettext_lazy as _
    12+
    from django.utils.translation import gettext
    13+
    from django.utils.translation import gettext_lazy as _
    1314

    1415
    from cms import api
    1516
    from cms.apphook_pool import apphook_pool
    @@ -20,7 +21,15 @@
    2021
    from cms.forms.validators import validate_overwrite_url, validate_relative_url, validate_url_uniqueness
    2122
    from cms.forms.widgets import AppHookSelect, ApplicationConfigSelect, UserSelectAdminWidget
    2223
    from cms.models import (
    23-
    CMSPlugin, GlobalPagePermission, Page, PagePermission, PageType, PageUser, PageUserGroup, Placeholder, Title,
    24+
    CMSPlugin,
    25+
    GlobalPagePermission,
    26+
    Page,
    27+
    PagePermission,
    28+
    PageType,
    29+
    PageUser,
    30+
    PageUserGroup,
    31+
    Placeholder,
    32+
    Title,
    2433
    TreeNode,
    2534
    )
    2635
    from cms.models.permissionmodels import User
    @@ -30,7 +39,10 @@
    3039
    from cms.utils.conf import get_cms_setting
    3140
    from cms.utils.i18n import get_language_list, get_language_object
    3241
    from cms.utils.permissions import (
    33-
    get_current_user, get_subordinate_groups, get_subordinate_users, get_user_permission_level,
    42+
    get_current_user,
    43+
    get_subordinate_groups,
    44+
    get_subordinate_users,
    45+
    get_user_permission_level,
    3446
    )
    3547
    from menus.menu_pool import menu_pool
    3648

    @@ -1021,9 +1033,9 @@ def __init__(self, *args, **kwargs):
    10211033
    # We can't set a queryset on a raw id lookup, but we can use
    10221034
    # the fact that it respects the limit_choices_to parameter.
    10231035
    if limit_choices:
    1024-
    self.fields['user'].widget.rel.limit_choices_to = dict(
    1025-
    id__in=list(sub_users.values_list('pk', flat=True))
    1026-
    )
    1036+
    self.fields['user'].widget.rel.limit_choices_to = {
    1037+
    "id__in": list(sub_users.values_list('pk', flat=True))
    1038+
    }
    10271039
    else:
    10281040
    self.fields['user'].widget = UserSelectAdminWidget()
    10291041
    self.fields['user'].queryset = sub_users

    cms/admin/pageadmin.py

    Lines changed: 28 additions & 9 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,4 +1,3 @@
    1-
    import copy
    21
    import json
    32
    import re
    43
    import sys
    @@ -18,7 +17,12 @@
    1817
    from django.db import router, transaction
    1918
    from django.db.models import Prefetch, Q
    2019
    from django.http import (
    21-
    Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseRedirect, QueryDict,
    20+
    Http404,
    21+
    HttpResponse,
    22+
    HttpResponseBadRequest,
    23+
    HttpResponseForbidden,
    24+
    HttpResponseRedirect,
    25+
    QueryDict,
    2226
    )
    2327
    from django.shortcuts import get_object_or_404, render
    2428
    from django.template.defaultfilters import escape
    @@ -27,20 +31,37 @@
    2731
    from django.urls import NoReverseMatch, re_path
    2832
    from django.utils.decorators import method_decorator
    2933
    from django.utils.encoding import force_str
    30-
    from django.utils.translation import get_language, gettext, gettext_lazy as _
    34+
    from django.utils.translation import get_language, gettext
    35+
    from django.utils.translation import gettext_lazy as _
    3136
    from django.views.decorators.http import require_POST
    3237

    3338
    from cms import operations
    3439
    from cms.admin.forms import (
    35-
    AddPageForm, AddPageTypeForm, AdvancedSettingsForm, ChangeListForm, ChangePageForm, CopyPageForm,
    36-
    CopyPermissionForm, DuplicatePageForm, MovePageForm, PagePermissionForm, PublicationDatesForm,
    40+
    AddPageForm,
    41+
    AddPageTypeForm,
    42+
    AdvancedSettingsForm,
    43+
    ChangeListForm,
    44+
    ChangePageForm,
    45+
    CopyPageForm,
    46+
    CopyPermissionForm,
    47+
    DuplicatePageForm,
    48+
    MovePageForm,
    49+
    PagePermissionForm,
    50+
    PublicationDatesForm,
    3751
    )
    3852
    from cms.admin.permissionadmin import PERMISSION_ADMIN_INLINES
    3953
    from cms.admin.placeholderadmin import PlaceholderAdminMixin
    4054
    from cms.cache.permissions import clear_permission_cache
    4155
    from cms.constants import PUBLISHER_STATE_PENDING
    4256
    from cms.models import (
    43-
    CMSPlugin, EmptyTitle, GlobalPagePermission, Page, PagePermission, PageType, StaticPlaceholder, Title,
    57+
    CMSPlugin,
    58+
    EmptyTitle,
    59+
    GlobalPagePermission,
    60+
    Page,
    61+
    PagePermission,
    62+
    PageType,
    63+
    StaticPlaceholder,
    64+
    Title,
    4465
    )
    4566
    from cms.plugin_pool import plugin_pool
    4667
    from cms.signals import post_obj_operation, pre_obj_operation
    @@ -258,8 +279,6 @@ def duplicate(self, request, object_id):
    258279
    if page is None:
    259280
    raise self._get_404_exception(object_id)
    260281

    261-
    request = copy.copy(request)
    262-
    263282
    if request.method == 'GET':
    264283
    # source is a field in the form
    265284
    # because its value is in the url,
    < 6EEC div class="d-flex flex-row">
    @@ -957,7 +976,7 @@ def copy_language(self, request, page_id):
    957976
    if page is None:
    958977
    raise self._get_404_exception(page_id)
    959978

    960-
    if not target_language or not target_language in get_language_list(site_id=page.node.site_id):
    979+
    if not target_language or target_language not in get_language_list(site_id=page.node.site_id):
    961980
    return HttpResponseBadRequest(force_str(_("Language must be set to a supported language!")))
    962981

    963982
    for placeholder in page.get_placeholders():

    0 commit comments

    Comments
     (0)
    0