mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
[5.0.x] Fixed #35198 -- Fixed facet filters crash on querysets with no primary key.
Thanks Simon Alef for the report. Regression in868e2fcdda. Backport ofa738281265from main
This commit is contained in:
committed by
Mariusz Felisiak
parent
24de8113a8
commit
80761c3b01
@@ -140,7 +140,7 @@ class SimpleListFilter(FacetsMixin, ListFilter):
|
||||
if lookup_qs is not None:
|
||||
counts[f"{i}__c"] = models.Count(
|
||||
pk_attname,
|
||||
filter=lookup_qs.query.where,
|
||||
filter=models.Q(pk__in=lookup_qs),
|
||||
)
|
||||
self.used_parameters[self.parameter_name] = original_value
|
||||
return counts
|
||||
|
||||
Reference in New Issue
Block a user