From 51561273aea71dd937709c9b44fc3f70f358c6e3 Mon Sep 17 00:00:00 2001 From: Jeremy Spencer Date: Fri, 14 Oct 2016 21:54:46 -0400 Subject: [PATCH] Fix for issue 398. Converts channels.binding.websockets.WebsocketBinding.fields to list before comparing to ['__all__'] to ensure most common data structures do not cause unexpected failures (i.e. ('__all__',), '__all__') (#399) --- channels/binding/websockets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/binding/websockets.py b/channels/binding/websockets.py index 76a442b..e458b6b 100644 --- a/channels/binding/websockets.py +++ b/channels/binding/websockets.py @@ -55,7 +55,7 @@ class WebsocketBinding(Binding): """ Serializes model data into JSON-compatible types. """ - if self.fields == ['__all__']: + if list(self.fields) == ['__all__']: fields = None else: fields = self.fields