-
Notifications
You must be signed in to change notification settings - Fork 66
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
UniqueConstraint with InlinePanel #192
Comments
This likely is an issue in django-modelcluster. The fix might be to pass django-modelcluster/modelcluster/forms.py Line 137 in 7e53fce
(Django ref: https://github.com/django/django/blob/97c05a64ca87253e9789ebaab4b6d20a1b2370cf/django/db/models/base.py#L1404) If you can hack your installed django-modelcluster, could you try making the following changes in - unique_checks, date_checks = form.instance._get_unique_checks()
+ unique_checks, date_checks = form.instance._get_unique_checks(include_meta_constraints=True) |
This seems to fix it, thanks for the very quick response. |
Do you need me to do anything else? Will this be part of the package? |
Issue Summary
Converting a
unique_together
toUniqueConstraint
results in an uncaughtIntegrityError
when trying to add a duplicate in a related model withInlinePanel
.I found this older issue relating to
unique_together
: wagtail/wagtail#2136I also found this issue, but it seems it's only for images? wagtail/wagtail#8715
Technical details
Python 3.12.7
5.1.2
6.2.2
FF 131.0.2
The text was updated successfully, but these errors were encountered: