Skip to content

Commit

Permalink
feat: remove empty messages from the room list (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder authored Jul 31, 2023
1 parent 952b753 commit 207df92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chats/apps/api/v1/rooms/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_unread_msgs(self, room: Room):
def get_last_message(self, room: Room):
last_message = (
room.messages.order_by("-created_on")
.exclude(user__isnull=True, contact__isnull=True)
.exclude(user__isnull=True, contact__isnull=True, text="")
.first()
)
return "" if last_message is None else last_message.text
Expand Down

0 comments on commit 207df92

Please sign in to comment.