onespacemedia / cms

A collection of Django extensions that add content-management facilities to Django projects.
BSD 3-Clause "New" or "Revised" License
14 stars 7 forks source link

`PageAdmin` does not call `full_clean()` on a page's content model #182

Open lewiscollard opened 4 years ago

lewiscollard commented 4 years ago

This has two effects, the first worse than the other:

1) It means that OneToOneField uniqueness constraints get enforced at the database level, rather than being checked by the validate_unique method on the model. This causes an invalid input in this field to raise IntegrityError, rather than rendering an error message in the admin.

2) It means you cannot put additional validation in the customary clean method of ContentBase derivatives.

This will probably require a minor rewrite of get_form in apps.pages.admin.PageAdmin.