Closed fsbraun closed 3 months ago
@fsbraun , I create a PR https://github.com/django-cms/djangocms-moderation/pull/263 it fixes all check errors and failed tests.
@fsbraun , about the failed pre-commit-config issue, It is related to the version of isort and other pre-commit plugins.
Freeman and I ever met this errors while fixing another repo.
refer to this: https://stackoverflow.com/questions/75269700/pre-commit-fails-to-install-isort-5-11-4-with-error-runtimeerror-the-poetry-co
@fsbraun ,
about the failed tests, it is because that djangocms-version-locking
addon create a monkeypatch to override djangocms-moderation.models.ModerationCollection._add_nested_children
method, it add a logic to check whether this version is locked. If locked, current children plugins will not be added to the current collection.
I didn't find when versionlock field in version instance is set, so I hard-code the version check and give the different return value.
@joshyu Thanks for the explanation. To me, this is very helpful: So that actually is a desired behavior. I also understand https://github.com/FidelityInternational/djangocms-version-locking/issues/80 now (an issue @marksweb raised a while ago)... Let me look into this, maybe we can identical results for CMS 4.0 and CMS 4.1 😃
@fsbraun, need your help to fix the left pre-commit error about 0001_squashed_0017_auto_20220831_0727.py file
@joshyu Pre-commit now passes. I'd like to look into the version locking effect on the collections with djangocms-versioning 2. Probably need today. Sufficient for you?
@joshyu I've updated the tests to test the same outcomes for djangocms-versioning 1 and 2. For most tests that means, removing the version lock before the test. I've also added a test that ensures that locked versions are not added to collections. If you're ok, I can merge.
@fsbraun ,
LGTM. Thank you for giving such a perfect solution, this is really better than my update on test_view.py
.
please help to merge it.
Thanks.
Description
This PR updates djangocms-moderation to support Django 4.2 and 5.0. It is based on the ideas and work of #256 by @Aiky30 .
If fixes tests so they can run with django CMS 4.0 and django CMS 4.1
DJANGOCMS_VERSIONING_LOCK_VERSIONS
setting set toTrue
.Since aldryn-forms does not support Django 4.2, the optional
djangocms-moderation.contrib.moderation_forms
app has been discontinued.Currently, tests against django CMS 4.0 fail (against django CMS 4.1 everything is fine). @joshyu: This is not an effect of this PR. Tests failed before already. Do you know why? I would love to get them in line.
Related resources
257
Checklist