summaryrefslogtreecommitdiffhomepage
path: root/apioforum/user.py
diff options
context:
space:
mode:
Diffstat (limited to 'apioforum/user.py')
-rw-r--r--apioforum/user.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/apioforum/user.py b/apioforum/user.py
index cdf38d3..af0539a 100644
--- a/apioforum/user.py
+++ b/apioforum/user.py
@@ -15,5 +15,11 @@ def view_user(username):
user = db.execute("SELECT * FROM users WHERE username = ?;",(username,)).fetchone()
if user is None:
abort(404)
+ posts = db.execute(
+ "SELECT * FROM posts WHERE author = ? ORDER BY created DESC LIMIT 25;",(username,)).fetchall()
+ rendered_posts = [render(post['content']) for post in posts]
return render_template("view_user.html",
- user=user, rendered_bio=render(user['bio'] or "hail GEORGE"))
+ user=user,
+ rendered_bio=render(user['bio'] or "hail GEORGE"),
+ posts=posts,
+ rendered_posts=rendered_posts)