Avoid NameError in example code. (#208)

'room' is used in the Group initialization but was not defined.
This commit is contained in:
Tommy Beadle 2016-06-14 15:41:03 -04:00 committed by Andrew Godwin
parent f8c1a9c688
commit 0fe9d2be2b

View File

@ -571,8 +571,9 @@ have a ChatMessage model with ``message`` and ``room`` fields::
# Connected to chat-messages
def msg_consumer(message):
# Save to model
room = message.content['room']
ChatMessage.objects.create(
room=message.content['room'],
room=room,
message=message.content['message'],
)
# Broadcast to listening sockets