Skip to content

Commit

Permalink
fix a bug where adding a comment to a comment tree that isn't cached …
Browse files Browse the repository at this point in the history
…creates a

broken comment page.
  • Loading branch information
spez committed Jul 31, 2009
1 parent a8331fd commit 58d101e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions r2/r2/lib/comment_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def add_comment_nolock(comment):

cids, comment_tree, depth, num_children = link_comments(link_id)

#make sure we haven't already done this before (which would happen
#if the tree isn't cached when you add a comment)
if comment._id in cids:
return

#add to comment list
cids.append(comment._id)

Expand Down

0 comments on commit 58d101e

Please sign in to comment.