support chat v3
This commit is contained in:
SDE
2023-08-14 14:54:22 +03:00
parent 3465563b27
commit 24f26dd0ea
5 changed files with 47 additions and 5 deletions

View File

@@ -18,8 +18,15 @@ class ChatConsumer(WebsocketConsumer):
f'user_{self.scope["user"].id}',
self.channel_name
)
print(f'self.room_group_name = {self.room_group_name}')
print(f'self.channel_name = {self.channel_name}')
print(f'created group user_{self.scope["user"].id}')
if self.scope['user'].is_staff:
async_to_sync(self.channel_layer.group_add)(
f'support_managers',
self.channel_name
)
print(f'add user {self.scope["user"].id} to group support_managers')
self.accept()