Fix DB query bug

This commit is contained in:
cuom1999 2021-11-21 21:12:42 -06:00
parent 7c3e59feec
commit a226496408

View file

@ -403,6 +403,7 @@ def get_unread_count(rooms, user):
mess = Message.objects.filter(room__isnull=True,
time__gte=OuterRef('last_seen'))\
.exclude(author=user)\
.order_by().values('room')\
.annotate(unread_count=Count('pk')).values('unread_count')
return UserRoom.objects\