diff --git a/flaskr/blog.py b/flaskr/blog.py index 9ae4adaf..e4008778 100644 --- a/flaskr/blog.py +++ b/flaskr/blog.py @@ -23,6 +23,8 @@ def index(): " FROM post p JOIN user u ON p.author_id = u.id" " ORDER BY created DESC" ).fetchall() + # Convert the immutable cursor to a list of dictionaries + posts = [dict(post) for post in posts] # Convert markdown to HTML for each post body for post in posts: post['body'] = markdown.markdown(post['body'])