Skip to content

Commit 30d0d8e

Browse files
committed
Use empty tuple instead of None in serializers fields __all__
The __fields value may be used elsewhere and it isn't expecting it to be None, rather an empty tuple. For example in sort_by_list later on.
1 parent dd7b59a commit 30d0d8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/django_elasticsearch_dsl_drf/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_fields(self):
200200
# Match drf convention of specifying "__all__" for all available fields
201201
# This is the existing behavior so we can ignore this value.
202202
if __fields == "__all__":
203-
__fields = None
203+
__fields = ()
204204

205205
for field_name, field_type in six.iteritems(document_fields):
206206
orig_name = field_name[:]

0 commit comments

Comments
 (0)