mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Delete temporary rendering attributes from the user.
Using safe_set_attr makes the Account not dirty, but it sets the attributes directly on the object rather than in the _t dict. If the account was later _commit()'ed it would get stuck with these extra attributes.
This commit is contained in:
committed by
Neil Williams
parent
a6da54dcfd
commit
c03a291ccf
@@ -405,8 +405,10 @@ def rendered_link(links, media, compress):
|
||||
with c.user.safe_set_attr:
|
||||
c.user.pref_compress = compress
|
||||
c.user.pref_media = media
|
||||
links = wrap_links(links, show_nums = True, num = 1)
|
||||
return links.render(style = "html")
|
||||
links = wrap_links(links, show_nums = True, num = 1)
|
||||
delattr(c.user, 'pref_compress')
|
||||
delattr(c.user, 'pref_media')
|
||||
return links.render(style = "html")
|
||||
|
||||
def rendered_comment(comments):
|
||||
return wrap_links(comments, num = 1).render(style = "html")
|
||||
|
||||
Reference in New Issue
Block a user