django/django — pull request #1913 by stephenmcd (2013-11-12 22:49:25+00:00)
Title: Fix 1.6 regression when GenericRelation+ForeignKey path used as admin list_filter

As mentioned in trac #21428

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 B__C 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.