Skip to content

Commit 87d8e66

Browse files
authored
Moved is_iterable dict check
1 parent 1bab341 commit 87d8e66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_elasticsearch_dsl/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ def get_value_from_instance(self, instance, field_value_to_ignore=None):
128128
if objs is None:
129129
return {}
130130
try:
131-
is_iterable = bool(iter(objs)) and not isinstance(objs, dict)
131+
is_iterable = bool(iter(objs))
132132
except TypeError:
133133
is_iterable = False
134134

135-
if is_iterable:
135+
if is_iterable and not isinstance(objs, dict):
136136
return [
137137
self._get_inner_field_data(obj, field_value_to_ignore)
138138
for obj in objs if obj != field_value_to_ignore

0 commit comments

Comments
 (0)