diff --git a/chat_box/models.py b/chat_box/models.py index fd35430..9ede6db 100644 --- a/chat_box/models.py +++ b/chat_box/models.py @@ -27,7 +27,7 @@ class Room(models.Model): @cache_wrapper(prefix="Rinfo") def _info(self): - last_msg = self.message_set.first() + last_msg = self.message_set.filter(hidden=False).first() return { "user_ids": [self.user_one.id, self.user_two.id], "last_message": last_msg.body if last_msg else None,