Fix chat last message body

This commit is contained in:
cuom1999 2023-12-05 20:06:56 -06:00
parent ff6988f29c
commit f75c2a391f

View file

@ -27,7 +27,7 @@ class Room(models.Model):
@cache_wrapper(prefix="Rinfo") @cache_wrapper(prefix="Rinfo")
def _info(self): def _info(self):
last_msg = self.message_set.first() last_msg = self.message_set.filter(hidden=False).first()
return { return {
"user_ids": [self.user_one.id, self.user_two.id], "user_ids": [self.user_one.id, self.user_two.id],
"last_message": last_msg.body if last_msg else None, "last_message": last_msg.body if last_msg else None,