Set attributes on Wrapped search result

This commit is contained in:
Brian Simpson
2016-02-01 11:17:03 -08:00
parent 6d2ce40fea
commit 6145561143

View File

@@ -1294,13 +1294,14 @@ class FrontController(RedditController):
def _search_builder_wrapper(self, q):
query = q.query
recent = q.recent
recent = str(q.recent) if q.recent else None
sort = q.sort
def wrapper_fn(thing):
thing.prev_search = query
thing.recent = recent
thing.sort = sort
w = Wrapped(thing)
w.prev_search = query
w.recent = recent
w.sort = sort
if isinstance(thing, Link):
w.render_class = SearchResultLink
elif isinstance(thing, Subreddit):