Fix DB query bug
This commit is contained in:
parent
7c3e59feec
commit
a226496408
1 changed files with 1 additions and 0 deletions
|
@ -403,6 +403,7 @@ def get_unread_count(rooms, user):
|
||||||
mess = Message.objects.filter(room__isnull=True,
|
mess = Message.objects.filter(room__isnull=True,
|
||||||
time__gte=OuterRef('last_seen'))\
|
time__gte=OuterRef('last_seen'))\
|
||||||
.exclude(author=user)\
|
.exclude(author=user)\
|
||||||
|
.order_by().values('room')\
|
||||||
.annotate(unread_count=Count('pk')).values('unread_count')
|
.annotate(unread_count=Count('pk')).values('unread_count')
|
||||||
|
|
||||||
return UserRoom.objects\
|
return UserRoom.objects\
|
||||||
|
|
Loading…
Reference in a new issue