main
emile 7 months ago
parent d582d8f656
commit cfe9d35262

@ -192,7 +192,7 @@ class Osichat(WebsocketConsumer):
chat_rooms = ChatRoom.objects.annotate(last_update=Max('chatmessage__date_sent'),order_key=Case( chat_rooms = ChatRoom.objects.annotate(last_update=Max('chatmessage__date_sent'),order_key=Case(
When(last_update__isnull=True, then=F('date_created')), When(last_update__isnull=True, then=F('date_created')),
default=F('last_update'), default=F('last_update'),
output_field=DateTimeField(),)).filter(chatroomguest__isnull=True, chatmember__member=self.scope["user"]).order_by('-order_key') output_field=DateTimeField(),)).filter(chatroomguest__isnull=True).order_by('-order_key')
context = { context = {
'chat_rooms': chat_rooms, 'chat_rooms': chat_rooms,
} }

Loading…
Cancel
Save