Skip to content

Commit

Permalink
Merge branch 'develop-4' into docs/apphook-rerouting
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed May 8, 2024
2 parents 5603f72 + 5ce5586 commit 4cf63ec
Show file tree
Hide file tree
Showing 66 changed files with 407 additions and 213 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---bug-report.md
Expand Up @@ -57,9 +57,9 @@ CMS/Python/Django versions, logs etc. here.

## Do you want to help fix this issue?

<!--
<!--
The django CMS project is managed and kept alive by its open source community and is backed by the [django CMS Association](https://www.django-cms.org/en/about-us/). We therefore welcome any help and are grateful if people contribute to the project. Please use 'x' to check the items below.
-->

* [ ] Yes, I want to help fix this issue and I will join #workgroup-pr-review on [Slack](https://www.django-cms.org/slack) to confirm with the community that a PR is welcome.
* [ ] Yes, I want to help fix this issue and I will join the channel #pr-reviews on [the Discord Server](https://discord-pr-review-channel.django-cms.org) to confirm with the community that a PR is welcome.
* [ ] No, I only want to report the issue.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---documentation-report.md
Expand Up @@ -35,9 +35,9 @@ CMS/Python/Django versions, logs etc. here.

## Do you want to help fix this documentation issue?

<!--
<!--
The django CMS project is managed and kept alive by its open source community and is backed by the [django CMS Association](https://www.django-cms.org/en/about-us/). We therefore welcome any help and are grateful if people contribute to the project. Please use 'x' to check the items below.
-->

* [ ] Yes, I want to help fix this issue and I will join #workgroup-documentation on [Slack](https://www.django-cms.org/slack) to confirm with the team that a PR is welcome.
* [ ] Yes, I want to help fix this issue and I will join the channel #documentation on our [Discord Server](https://discord-docs-channel.django-cms.org) to confirm with the team that a PR is welcome.
* [ ] No, I only want to report the issue.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -27,4 +27,4 @@ Use 'x' to check each item: [x] I have ...
* [ ] I have opened this pull request against ``develop-4``
* [ ] I have added or modified the tests when changing logic
* [ ] I have followed [the conventional commits guidelines](https://www.conventionalcommits.org/) to add meaningful information into the changelog
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined #workgroup-pr-review on [Slack](https://www.django-cms.org/slack) to find a “pr review buddy” who is going to review my pull request.
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined the channel #pr-reviews on our [Discord Server](https://discord-pr-review-channel.django-cms.org) to find a “pr review buddy” who is going to review my pull request.
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Expand Up @@ -15,6 +15,6 @@ jobs:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.4.0
- uses: amannn/action-semantic-pull-request@v5.5.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/new_contributor_pr.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
As it's your first contribution, be sure to check out the [contribution docs](https://docs.django-cms.org/en/latest/contributing/index.html).
If you're a Slack user and haven't joined us, please do [here](https://www.django-cms.org/slack)!
We invite you to join us on our [Discord Server](https://discord-main-channel.django-cms.org)!
Welcome aboard ⛵️!
discord:
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.rst
@@ -1,3 +1,73 @@
4.1.1 (2024-04-30)
==================

Features:
---------
* send post request if toolbar button has `cms-form-post-method` class (bb31ba990) -- Fabian Braun
* Add RTL support to modal header and related components (#7863) (bef004550) -- Moe
* Add RTL support to toolbar (#7871) (92a1086de) -- Moe
* add versioned deprecation warnings (#7750) (545ea1f6d) -- Fabian Braun
* Added new contributor message based on django's own version (#7797) (311af6cf3) -- Mark Walker

Bug Fixes:
----------
* Placeholders must not block deletion of their source objects (ccb2e8b3b) -- Fabian Braun
* structure board on the right for ltr (a4c6ccb68) -- Fabian Braun
* CMS widgets need not load if they are read only (#7880) (fb30434e4) -- Fabian Braun
* some Django antipatterns (#7867) (c436cf45a) -- Jacob Rief
* Redirects to newly created object (#7864) (0b43a43c3) -- Fabian Braun
* `views.details` revealed existence of unpublished language (#7853) (fa7b89cee) -- Fabian Braun
* Render structure view in toolbar object's language (#7846) (d123d118d) -- Fabian Braun
* Add RTL support to pagetree (#7817) (21d6a6def) -- Moe
* 7828, try using uv as pip replacement (#7829) (08463c274) -- Vinit Kumar
* Efficient build menu for versioned and unversioned pages (#7807) (b0f59bb55) -- Fabian Braun
* Delete orphaned plugin management command for django CMS 4 (#7814) (3e635d3db) -- Fabian Braun
* render content in place `redirect_on_fallback` is False (#7781) (e264d0400) -- Moe
* solved issue #7818 (#7819) (087fa3ec7) -- Raffaella
* Port forward #7070 - faster DOM update after editing (#7787) (26b081a31) -- Fabian Braun
* return _handle_no_page when page is None (#7786) (ce8d5d557) -- Moe
* Redirect user to edit url after a successful page creation (#7772) (f290e3d09) -- Moe
* editing of apphooked CMS pages without apphook landing page (#7766) (cd6df846b) -- Philipp S. Sommer
* make messages readable in dark mode, let user close long messages (#7740) (68749cbb3) -- Fabian Braun
* Replace the VCS pip installs with release name in docs (#7755) (10e9b5327) -- sakhawy
* Incorrect commands to migrate database in docs (#7754) (082214be6) -- sakhawy
* Incomplete command to create a virtual env in docs (#7735) (490dffab1) -- Fabian Braun

Statistics:
-----------

This release includes 89 pull requests, and was created with the help of the following contributors (in alphabetical order):

* Aiden-RC (2 pull requests)
* Erdenebat Oyungerel (1 pull request)
* Fabian Braun (37 pull requests)
* Github Release Action (4 pull requests)
* Jacob Rief (4 pull requests)
* Mario Colombo (1 pull request)
* Mark Walker (9 pull requests)
* Miloš Nikić (1 pull request)
* Moe (6 pull requests)
* Philipp S. Sommer (1 pull request)
* Raffaella (1 pull request)
* Vinit Kumar (1 pull request)
* dependabot[bot] (0 pull request)
* sakhawy (2 pull requests)
* sparrow (1 pull request)

With the review help of the following contributors:

* Fabian Braun
* Github Release Action
* Jacob Rief
* Leonardo Cavallucci
* Mario Colombo
* Mark Walker
* Vinit Kumar
* dependabot[bot]
* nichoski

Thanks to all contributors for their efforts!

4.1.0 (2023-12-22)
==================

Expand Down
10 changes: 3 additions & 7 deletions CONTRIBUTING.rst
Expand Up @@ -29,7 +29,7 @@ Here’s what the pull request process looks like in brief:
1. Fork our GitHub repository, https://github.com/django-cms/django-cms
2. Work locally and push your changes to your repository.
3. When you feel your code is good enough for inclusion, send us a pull request.
4. After that, please join the `Slack Channel <https://www.django-cms.org/slack>`_ of our Pull Request Review work group (#workgroup-pr-review). This group of friendly community members is dedicated to reviewing pull requests. Report your PR and find a “pr review buddy” who is going to review your pull request.
4. After that, please join our `Discord Server <https://discord-pr-review-channel.django-cms.org>`_ . This group of friendly community members is dedicated to reviewing pull requests. Report your PR and find a “pr review buddy” who is going to review your pull request.
5. Get acknowledged by the django CMS community for your contribution :-)

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#>`_.
Expand All @@ -48,7 +48,7 @@ To create a proposal...

2. create a discussion in the main `django CMS repository <https://github.com/django-cms/django-cms/discussions>`_

3. join the `Tech Committee <https:/github.com/django-cms/django-cms-mgmt/blob/master/tech-committee/about.md>`_ `Slack Channel <https://www.django-cms.org/slack>`_ (#technical-committee) and ask for a RFC.
3. join the `Tech Committee <https:/github.com/django-cms/django-cms-mgmt/blob/master/tech-committee/about.md>`_ `Channel <https://discord-tech-committee-channel.django-cms.org>`_ (#technical-committee) and ask for a RFC.

4. After RFC is completed, add the proposal to the `agenda <https://hackmd.io/ddhvq_aqS6my9gwhLddyPg>`_ of the TC for approval.

Expand All @@ -75,16 +75,12 @@ Community & Association

You can join us online:

* in our `django CMS Slack channel <https://www.django-cms.org/slack>`_
* at our `django CMS Discord Server <https://discord-main-channel.django-cms.org>`_

You can join a work group and work collaboratively on django CMS

* `work groups <https://www.django-cms.org/en/join-work-group/>`_

You can also follow:

* the `@djangocms <https://twitter.com/djangocms>`_ Twitter account for general announcements

You can become a member of the django CMS Association and receive benefits

* `Membership <https://www.django-cms.org/en/memberships/>`_
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -96,7 +96,7 @@ The demo platform is kindly provided by Divio, platinum member of the django CMS
Getting Help
************

Please head over to our `discord forum <https://www.django-cms.org/discord>`_ for support.
Please head over to our `Discord Server <https://discord-support-channel.django-cms.org>`_ or Stackoverflow for support.

********************
Professional support
Expand Down
2 changes: 1 addition & 1 deletion cms/__init__.py
@@ -1,3 +1,3 @@
__version__ = '4.1.0'
__version__ = '4.1.1'

default_app_config = 'cms.apps.CMSConfig'
12 changes: 0 additions & 12 deletions cms/admin/pageadmin.py
Expand Up @@ -369,11 +369,6 @@ def delete_view(self, request, object_id, extra_context=None):
**get_deleted_objects_additional_kwargs
)

# `django.contrib.admin.utils.get_deleted_objects()` only returns the verbose_name of a model,
# we hence have to use that name in order to allow the deletion of objects otherwise prevented.
perms_needed.discard(Placeholder._meta.verbose_name)
perms_needed.discard(PageContent._meta.verbose_name)

if request.POST and not protected: # The user has confirmed the deletion.
if perms_needed:
raise PermissionDenied
Expand Down Expand Up @@ -1263,13 +1258,6 @@ def delete_view(self, request, object_id, extra_context=None):
list(perms_needed_url) + list(perms_needed_translation) + list(perms_needed_plugins)
)

# This is bad and I should feel bad.
if 'placeholder' in perms_needed:
perms_needed.remove('placeholder')

if 'page content' in perms_needed:
perms_needed.remove('page content')

if request.method == 'POST':
if perms_needed:
raise PermissionDenied
Expand Down
12 changes: 11 additions & 1 deletion cms/admin/placeholderadmin.py
Expand Up @@ -192,17 +192,27 @@ class PlaceholderAdminMixin(metaclass=PlaceholderAdminMixinBase):
class PlaceholderAdmin(admin.ModelAdmin):

def has_add_permission(self, request):
# Placeholders are created by the system
return False

def has_change_permission(self, request, obj=None):
# Placeholders are not editable in the admin
return False

def has_delete_permission(self, request, obj=None):
return False
# Placeholders are deleted by cascading the deletion of their source object
# so we don't need to check for delete permissions here.
return True

def has_module_permission(self, request):
# Do not show in admin
return False

def delete_view(self, request, object_id, extra_context=None):
# Placeholder are deleted by cascading the deletion of their source object
# but the admin's delete view is not available for placeholders.
raise PermissionDenied

def get_urls(self):
"""
Register the plugin specific urls (add/edit/copy/remove/move)
Expand Down
8 changes: 7 additions & 1 deletion cms/cache/placeholder.py
Expand Up @@ -119,7 +119,13 @@ def _get_placeholder_cache_key(placeholder, lang, site_id, request, soft=False):
if sub_key_list:
cache_key += '|' + '|'.join(sub_key_list)

if len(cache_key) > 250:
# django itself adds "version" add the end of cache-keys, e.g. "<key>:1".
# -> If `cache.set()` is for example called with `version=""`, it still adds
# `:` at the end. So if we check the length for `> 250`, a length of 249
# or even 250 ends up in an InvalidCacheKey-exception.
# In order to avoid these errors, we hash the keys at a lower length to also
# have a little buffer.
if len(cache_key) > 200:
cache_key = '{prefix}|{hash}'.format(
prefix=prefix,
hash=hashlib.sha1(cache_key.encode('utf-8')).hexdigest(),
Expand Down
Binary file modified cms/locale/ar/LC_MESSAGES/django.mo
Binary file not shown.

0 comments on commit 4cf63ec

Please sign in to comment.