#25431: ModelFormset regression in object clean() accessing a FK
---------------------------------+--------------------------------------
Reporter: claudep | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: regression | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Comment (by claudep):
Just apply that patch to reproduce the problem in Django's test suite:
{{{
#!diff
diff --git a/tests/model_formsets/models.py
b/tests/model_formsets/models.py
index df6a687..7b7337f 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):
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25431#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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.42a8843c21baa69822950a1e485be31e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.