#26200: Integrity constraint violations when ForeignKey field is not included on the ModelForm --------------------------+-------------------------------------- Reporter: goodtune | Owner: nobody Type: Bug | Status: new Component: Forms | Version: 1.8 Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------+-------------------------------------- Changes (by goodtune):
* needs_better_patch: => 0 * needs_tests: => 0 * needs_docs: => 0 Comment: On further searching of the developers mailing list, this might be a partial of #13091? I hadn't experienced the behaviour on non-FK fields, but it would not be too difficult remove the `if isinstance(self.instance._meta.get_field(field_name), models.ForeignKey)` check. Unfortunately makes `model_forms.tests.ModelFormBaseTest.test_exclude_and_validation` fail, and the comment in that test notes ''"This is for backwards compatibility."'' which is worrying since #13091 is 6 years old! -- Ticket URL: <https://code.djangoproject.com/ticket/26200#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.7bce031ad2b889276e12ba1dcc6ad592%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.