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:
bsimpson63
2012-10-18 10:58:23 -04:00
committed by Neil Williams
parent a6da54dcfd
commit c03a291ccf

View File

@@ -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")