build: upgrade to Django 5.2 and django-cms 4.x#2202
Draft
build: upgrade to Django 5.2 and django-cms 4.x#2202
Conversation
9af67f0 to
30a5f90
Compare
This commit upgrades the project from Django 4.2.x to Django 5.2 and from django-cms 3.11.x to django-cms 4.x with djangocms-versioning. Key changes: **Django 5.2 compatibility:** - Logout now requires POST instead of GET - User.objects.make_random_password() removed - use secrets module - Form field choices return tuples instead of lists **CMS 4.x with djangocms-versioning:** - Page.is_published() removed - use Version model to check state - page.publish() removed - use versioning API via _publish_page() helper - api.create_page() requires created_by parameter for version creation - Placeholders are on PageContent, not Page - Use PageContent.admin_manager to access draft content **Test infrastructure:** - Added cms_tools helpers: _cleanup_cms_test_user(), user_queryset() - Updated OIDC tests to exclude CMS system user from counts - Fixed menu tests for CMS 4.x versioning behavior - Added data migration for ExtendedCMSLink link field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move CMS versioning helpers from utils.py to utils/__init__.py to fix ImportError. Python's import system treats the directory as a package and ignores the file, causing the `has_published_apphook` import to fail. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30a5f90 to
33e864c
Compare
The MaybeEncodingError in Django 5.x's parallel test runner occurs when structlog's BoundLogger objects (which can't be pickled) are included in test results that need to be serialized between processes. This fix: - Sets LOG_REQUESTS=no to disable django_structlog middleware in CI - Reconfigures structlog with cache_logger_on_first_use=False to prevent caching of loggers that could contain unpicklable state Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Python's structural pattern matching doesn't work correctly with Django's TextChoices enums. The match statement was returning None instead of the expected logout URLs because the pattern matching comparison mechanism differs from regular equality checks. Using if/elif with explicit equality comparisons ensures correct behavior when comparing the string value stored in the database with TextChoices enum members. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Install tblib.pickling_support early in CI settings to enable pickling of traceback objects. This prevents MaybeEncodingError when running tests in parallel and a test failure occurs, as the traceback objects containing local function references can now be properly serialized between processes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch created with Claude / Opus, still requires review from my end:
Breaking changes addressed:
Files updated for CMS 4.x compatibility:
Note: Existing CMS content will need migration using djangocms-4-migration tool.
Co-Authored-By: Claude
Summary
Issue References
Checklist
docker-compose.ymlenvironment variablesenvironment variables