Permalink
Browse files

CommentPane: try to avoid building comment tree if possible.

  • Loading branch information...
1 parent d0babbd commit cf2d5625efc9cbc6c903bd579ebb6e4a03c242d1 @spladug spladug committed Dec 6, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 r2/r2/lib/pages/pages.py
View
@@ -1168,11 +1168,11 @@ def renderer():
parent_name = article._fullname)
return listing.listing()
- # generate the listing we would make for this user if caching is disabled.
- my_listing = renderer()
-
- # for now, disable the cache if the user happens to be an author of anything.
+ # disable the cache if the user is the author of anything in the
+ # thread because of edit buttons etc.
+ my_listing = None
if try_cache and c.user_is_loggedin:
+ my_listing = renderer()
for t in self.listing_iter(my_listing):
if getattr(t, "is_author", False):
try_cache = False
@@ -1239,6 +1239,7 @@ def renderer():
saves = saves).render()
g.log.debug("using comment page cache")
else:
+ my_listing = my_listing or renderer()
self.rendered = my_listing.render()
if try_cache:

0 comments on commit cf2d562

Please sign in to comment.