Commit 2687f2e
Silence polymorphic.W001 and polymorphic.W002 system checks
The Question and Answer models intentionally use models.Manager() as
their default objects manager instead of PolymorphicManager(). This is
a deliberate trade-off introduced in #9574 to fix cascade deletion
failures (ForeignKeyViolation on dojo_choiceanswer and ValueError during
Product/ProductType deletion) caused by Django's inability to correctly
order polymorphic child row deletions before parent row deletions when
using PolymorphicManager as the default.
Using models.Manager() as the default ensures Django's collector can
walk the full object graph and delete child rows (TextAnswer,
ChoiceAnswer) before their parent Answer rows, satisfying FK constraints.
A named polymorphic manager is retained on both models for all queryset
operations that require polymorphic behavior (used throughout
dojo/survey/views.py and dojo/forms.py).
The resulting polymorphic.W001 and polymorphic.W002 warnings are
therefore expected and benign — they describe the intentional
configuration, not a bug. Silencing them here prevents noise in CI
and local development output without masking any real misconfiguration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c6b4b8d commit 2687f2e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments