diff --git a/files/routes/posts.py b/files/routes/posts.py index 2540b94a6..1c54ddfd0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -207,9 +207,9 @@ def post_id(pid, anything=None, v=None, sub=None): pin.stickied_utc = None g.db.add(pin) elif pin.level > 1: - pinned2.add(pin.top_comment) + pinned2.add(pin.top_comment(g.db)) if pin.top_comment in comments: - comments.remove(pin.top_comment) + comments.remove(pin.top_comment(g.db)) else: pinned2.add(pin) diff --git a/files/templates/comments.html b/files/templates/comments.html index c3735e93b..d62e343ac 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -739,7 +739,7 @@ {% endif %} {% endmacro %} -{% for comment in comments(g.db) if comment.can_see(v) %} +{% for comment in comments if comment.can_see(v) %} {{single_comment(comment)}} {% endfor %}