mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Avoid NameError in example code. (#208)
'room' is used in the Group initialization but was not defined.
This commit is contained in:
parent
f8c1a9c688
commit
0fe9d2be2b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user