From e6236f79e63aeeded59cc0d546ad55839cf44520 Mon Sep 17 00:00:00 2001 From: Krukov D Date: Fri, 26 Aug 2016 22:12:14 +0300 Subject: [PATCH] Move the groups at class definition (#321) --- channels/generic/websockets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/channels/generic/websockets.py b/channels/generic/websockets.py index 6c0820f..272b938 100644 --- a/channels/generic/websockets.py +++ b/channels/generic/websockets.py @@ -27,6 +27,8 @@ class WebsocketConsumer(BaseConsumer): slight_ordering = False strict_ordering = False + groups = None + def get_handler(self, message, **kwargs): """ Pulls out the path onto an instance variable, and optionally @@ -54,7 +56,7 @@ class WebsocketConsumer(BaseConsumer): Group(s) to make people join when they connect and leave when they disconnect. Make sure to return a list/tuple, not a string! """ - return [] + return self.groups or [] def raw_connect(self, message, **kwargs): """