mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-24 09:48:48 +02:00
@ -4,6 +4,8 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from chat.models import Channel
|
||||
|
||||
|
||||
class ChatView(LoginRequiredMixin, TemplateView):
|
||||
"""
|
||||
@ -11,3 +13,9 @@ class ChatView(LoginRequiredMixin, TemplateView):
|
||||
with Javascript and websockets.
|
||||
"""
|
||||
template_name = "chat/chat.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
from asgiref.sync import async_to_sync
|
||||
context['channels'] = async_to_sync(Channel.get_accessible_channels)(self.request.user, 'read')
|
||||
return context
|
||||
|
Reference in New Issue
Block a user