diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-09-19 14:23:55 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-09-21 21:30:49 +0200 |
| commit | 65a1055a36318ff4e21ffeb7c3dd62fa81892269 (patch) | |
| tree | 898d79ec9b34d4b6693b3830c1b221696eed9222 /tests/model_formsets | |
| parent | c07f9fef398a21a76d350e8b02b396b3e580b751 (diff) | |
Fixed #25431 -- Readded inline foreign keys to modelformset instances
Too much field exclusions in form's construct_instance() in _post_clean()
could lead to some unexpected missing ForeignKey values.
Fixes a regression from 45e049937. Refs #13776.
Diffstat (limited to 'tests/model_formsets')
| -rw-r--r-- | tests/model_formsets/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/model_formsets/models.py b/tests/model_formsets/models.py index df6a68792b..7b7337fd52 100644 --- a/tests/model_formsets/models.py +++ b/tests/model_formsets/models.py @@ -37,6 +37,10 @@ class Book(models.Model): def __str__(self): return self.title + def clean(self): + # Ensure author is always accessible in clean method + assert self.author.name is not None + @python_2_unicode_compatible class BookWithCustomPK(models.Model): |
