Skip to content

Commit 4b75f86

Browse files
Merge pull request #203 from belthaZornv/master
Bug-fix: Popping of the `path` option
2 parents 3d1debd + 9dbb142 commit 4b75f86

File tree

1 file changed

+2
-4
lines changed
  • src/django_elasticsearch_dsl_drf/filter_backends/filtering

1 file changed

+2
-4
lines changed

src/django_elasticsearch_dsl_drf/filter_backends/filtering/nested.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,19 @@ def apply_filter(cls, queryset, options=None, args=None, kwargs=None):
177177
:param kwargs:
178178
:return:
179179
"""
180-
if options is None:
180+
if options is None or 'path' not in options:
181181
raise ImproperlyConfigured(
182182
"You should provide an `path` argument in the field options."
183183
)
184184

185-
path = options.pop('path')
186-
187185
if args is None:
188186
args = []
189187
if kwargs is None:
190188
kwargs = {}
191189

192190
return queryset.query(
193191
'nested',
194-
path=path,
192+
path=options.get('path'),
195193
query=Q(*args, **kwargs)
196194
)
197195

0 commit comments

Comments
 (0)