Update render to include user info.

This commit is contained in:
retoor 2025-05-27 10:30:31 +02:00
parent 36e663e1ed
commit 3c6ea15d47

View File

@ -51,7 +51,17 @@ class ChannelMessageService(BaseService):
}
async def save(self, model):
context = model.record
context = {}
content.update(model.record)
user = await self.app.services.user.get(model['user_uid'])
context.update(
{
"user_uid": user["uid"],
"username": user["username"],
"user_nick": user["nick"],
"color": user["color"],
}
)
template = self.app.jinja2_env.get_template("message.html")
model["html"] = template.render(**context)
return await super().save(model)