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

feat: Django 4.2, Django CMS 4.1.0rc2 compatibility, and version locking #326

Merged
merged 53 commits into from
May 15, 2023

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Apr 26, 2023

Description

This PR adds tests for Django 4.2 and mixins for django CMS' GrouperModelAdmin class (new in 4.2rc2). It includes the version locking functionality. Version locking is activated by setting DJANGOCMS_VERSIONING_LOCK_VERSIONS = True in the project settings.

Documentation has been updated and tests have been added.

To stay DRY and avoid code repetition, the djangocms_versioning.admin module has been slightly refactored. ExtendedListDisplayMixin encapsulates the extension of the change list view of versioned objects using django CMS 4's new config feature. Both versioned grouper admins and versioned content admins inherit it.

Djangocms Versioning now supports both versioned grouper model admins and versioned content model admins. The latter are backwards compatible.

Related resources

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #326 (d836487) into master (2ce8647) will increase coverage by 0.37%.
The diff coverage is 94.84%.

@@            Coverage Diff             @@
##           master     #326      +/-   ##
==========================================
+ Coverage   90.55%   90.93%   +0.37%     
==========================================
  Files          69       72       +3     
  Lines        2329     2536     +207     
  Branches      314      358      +44     
==========================================
+ Hits         2109     2306     +197     
- Misses        165      170       +5     
- Partials       55       60       +5     
Impacted Files Coverage Δ
djangocms_versioning/__init__.py 100.00% <ø> (ø)
...s_versioning/migrations/0013_auto_20181005_1404.py 100.00% <ø> (ø)
djangocms_versioning/cms_config.py 80.90% <50.00%> (-0.87%) ⬇️
djangocms_versioning/emails.py 82.14% <82.14%> (ø)
djangocms_versioning/models.py 94.44% <89.47%> (-0.62%) ⬇️
djangocms_versioning/helpers.py 91.35% <92.30%> (-0.14%) ⬇️
djangocms_versioning/admin.py 90.70% <97.81%> (+1.56%) ⬆️
djangocms_versioning/cms_toolbars.py 96.90% <100.00%> (+0.95%) ⬆️
djangocms_versioning/conditions.py 98.18% <100.00%> (+1.51%) ⬆️
djangocms_versioning/conf.py 100.00% <100.00%> (ø)
... and 7 more

@fsbraun fsbraun requested a review from marksweb April 26, 2023 20:58
tests/test_admin.py Fixed Show fixed Hide fixed
@fsbraun fsbraun marked this pull request as ready for review May 5, 2023 19:59
@fsbraun fsbraun marked this pull request as draft May 5, 2023 20:00
@fsbraun fsbraun changed the title feat: Django 4.2 and Django CMS 4.1.0rc2 compatibility feat: Django 4.2, Django CMS 4.1.0rc2 compatibility, and version locking May 5, 2023
@fsbraun fsbraun marked this pull request as ready for review May 5, 2023 20:21
@fsbraun
Copy link
Member Author

fsbraun commented May 7, 2023

Just added ruff as linter link just as in #329

)
from djangocms_versioning.models import Version
from .constants import ARCHIVED, DRAFT, PUBLISHED, UNPUBLISHED, VERSION_STATES
from .models import Version

Check notice

Code scanning / CodeQL

Cyclic import

Import of module [djangocms_versioning.models](1) begins an import cycle.
@fsbraun fsbraun removed the request for review from marksweb May 12, 2023 13:14
Copy link
Member

@marksweb marksweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@marksweb marksweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fsbraun fsbraun merged commit e7744d1 into django-cms:master May 15, 2023
@fsbraun fsbraun deleted the fix/rc2_compat branch May 15, 2023 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants