mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
bugfixes for caching patch
This commit is contained in:
@@ -70,6 +70,8 @@ class ButtonsController(RedditController):
|
||||
import traceback
|
||||
g.log.debug("FULLPATH: get_link error in buttons code")
|
||||
g.log.debug(traceback.format_exc())
|
||||
if wrapper:
|
||||
return wrapper(None)
|
||||
|
||||
|
||||
@validate(url = VSanitizedUrl('url'),
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
# CondeNet, Inc. All Rights Reserved.
|
||||
################################################################################
|
||||
from utils import to36, tup, iters
|
||||
from wrapped import Wrapped, StringTemplate, CacheStub, CachedVariable
|
||||
from wrapped import Wrapped, StringTemplate, CacheStub, CachedVariable, Templated
|
||||
from mako.template import Template
|
||||
from r2.lib.filters import spaceCompress, safemarkdown
|
||||
import time, pytz
|
||||
@@ -90,7 +90,8 @@ class UserItemJsonTemplate(TableRowTemplate):
|
||||
def cells(self, thing):
|
||||
cells = []
|
||||
for cell in thing.cells:
|
||||
r = Templated.part_render(thing, 'cell_type', cell)
|
||||
thing.name = cell
|
||||
r = thing.part_render('cell_type', style = "html")
|
||||
cells.append(spaceCompress(r))
|
||||
return cells
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ class Subreddit(Thing, Printable):
|
||||
@classmethod
|
||||
def add_props(cls, user, wrapped):
|
||||
names = ('subscriber', 'moderator', 'contributor')
|
||||
rels = (SRMember._fast_query(wrapped, [user], names) if user else {})
|
||||
rels = (SRMember._fast_query(wrapped, [user], names) if c.user_is_loggedin else {})
|
||||
defaults = Subreddit.default_subreddits()
|
||||
for item in wrapped:
|
||||
if not user or not user.has_subscribed:
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<%def name="parent()">
|
||||
%if c.profilepage:
|
||||
<small>
|
||||
<a href="${thing.ancestor.url}">${thing.ancestor.titleprefix}${thing.ancestor.title}</a></small><br \>
|
||||
<a href="${thing.link.url}">${thing.link.title}</a></small><br \>
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<%def name="parent()">
|
||||
%if c.profilepage:
|
||||
<small>
|
||||
<a href="${thing.ancestor.url}">${thing.ancestor.titleprefix}${thing.ancestor.title}</a></small><br \>
|
||||
<a href="${thing.link.url}">${thing.link.title}</a></small><br \>
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<%inherit file="printable.htmllite" />
|
||||
|
||||
<%def name="entry()">
|
||||
<tr><td valign="top" rowspan="2" class="number">$num</td>
|
||||
<tr><td valign="top" rowspan="2" class="number">${thing.num}</td>
|
||||
<td>
|
||||
<a target="reddit_pop" href="${thing.url}" class="title">${thing.title}</a>
|
||||
<span class="small"> (${thing.domain})</span>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<table>
|
||||
%for a in thing.things:
|
||||
${unsafe(replace_render(thing, a))}
|
||||
${a}
|
||||
%endfor:
|
||||
</table>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
${thing.classname and ("classname=%s" % str(thing.classname))}>\
|
||||
%endif
|
||||
%for t in thing.stack:
|
||||
${t.render()}
|
||||
${t}
|
||||
%endfor
|
||||
%if div:
|
||||
</div>
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
|
||||
<%inherit file="base.wired"/>
|
||||
|
||||
${thing.content().render()}
|
||||
${thing.content()}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
%endfor
|
||||
</tr>
|
||||
|
||||
<%def name="cell_type(name)">
|
||||
%if name == "user":
|
||||
<%def name="cell_type()">
|
||||
%if thing.name == "user":
|
||||
<span class="user">
|
||||
${plain_link(thing.user.name, "/user/%s/" % thing.user.name,
|
||||
_sr_path=False)}
|
||||
@@ -43,7 +43,7 @@
|
||||
${plain_link(_("send message"),
|
||||
"/message/compose?to=%s" % (thing.user.name))}
|
||||
|
||||
%elif name == "remove" and thing.editable:
|
||||
%elif thing.name == "remove" and thing.editable:
|
||||
${ynbutton(_("remove"), "removed", "unfriend",
|
||||
callback="deleteRow",
|
||||
hidden_data = dict(type = thing.type,
|
||||
|
||||
Reference in New Issue
Block a user