Skip to content

Conversation

@tognee
Copy link
Contributor

@tognee tognee commented Nov 26, 2025

This PR lets users set a ManyToManyField as a SynchronizedField without recieving the error:

Direct assignment to the forward side of a many-to-many set is prohibited. Use model_name.set() instead.

This does not solve the issue of whether a ManyToMany field should be translatable or syncronized, but gives the option for the user to syncronize it without errors.

This PR adds:

  • the code changes to handle many to many fields
  • a snippet model to test ManyToMany fields (with its migration)
  • 3 unit tests to check if the SynchronizedField is respected correctly for ManyToMany

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.08%. Comparing base (420d774) to head (cb1d719).

Files with missing lines Patch % Lines
wagtail_localize/test/models.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #891      +/-   ##
==========================================
+ Coverage   93.07%   93.08%   +0.01%     
==========================================
  Files          47       47              
  Lines        4244     4254      +10     
  Branches      551      552       +1     
==========================================
+ Hits         3950     3960      +10     
  Misses        175      175              
  Partials      119      119              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tognee
Copy link
Contributor Author

tognee commented Nov 28, 2025

I've seen that bitnami moved all free postgresql images to bitnamilegacy. I changed it just to test the checks, but I think it could it be replaced with the official docker postgresql image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants