Django 1.6 GenericRelation admin list_filter regression
|Reported by:||stephenmcd||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Previously in 1.5 it was possible to have a model A with a GenericRelation field to a model B that had a ForeignKey to model C, and use the BC path in A's admin list_filter.
In 1.6 this fails in django.contrib.admin.util.get_model_from_relation where the model on the wrong side of the relationship is returned, when the correct model is available via the parent_model attribute.
I've created a fix and test case here: https://github.com/django/django/pull/1913
Although as discussed, the fix should probably be different.
Change History (4)
comment:1 Changed 3 years ago by akaariai
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:3 Changed 3 years ago by Anssi Kääriäinen <akaariai@…>
- Resolution set to fixed
- Status changed from new to closed