diff --git a/django_elasticsearch_dsl/search.py b/django_elasticsearch_dsl/search.py index bc66d82..68b2ced 100644 --- a/django_elasticsearch_dsl/search.py +++ b/django_elasticsearch_dsl/search.py @@ -20,7 +20,7 @@ def filter_queryset(self, queryset, keep_search_order=True): It costs a query to the sql db. """ s = self - if s._model is not queryset.model: + if s._model._wrapped is not queryset.model: raise TypeError( 'Unexpected queryset model ' '(should be: %s, got: %s)' % (s._model, queryset.model)