From ee09d881a4db6b148b4f8e8e1b24a4964d79d0a4 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Mon, 29 Aug 2016 16:24:35 -0400 Subject: [PATCH] only discard if groups have been created previously --- awx/main/consumers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/main/consumers.py b/awx/main/consumers.py index 8b02f53d87..990e197cd2 100644 --- a/awx/main/consumers.py +++ b/awx/main/consumers.py @@ -5,9 +5,10 @@ from channels.sessions import channel_session def discard_groups(message): - for group in message.channel_session['groups']: - print("removing from group: {}".format(group)) - Group(group).discard(message.reply_channel) + if 'groups' in message.channel_session: + for group in message.channel_session['groups']: + print("removing from group: {}".format(group)) + Group(group).discard(message.reply_channel) @channel_session def ws_disconnect(message):