from snek.system.view import BaseView


class UserView(BaseView):

    async def get(self):
        user_uid = self.request.match_info.get("user")
        user = await self.services.user.get(uid=user_uid)
        profile_content = (
            await self.services.user_property.get(user["uid"], "profile") or ""
        )
        return await self.render_template(
            "user.html",
            {"user_uid": user_uid, "user": user.record, "profile": profile_content},
        )
