Cleaned up SubmissionContent.from_name()

This commit is contained in:
Michael Lazar
2015-04-04 14:12:25 -07:00
parent 48f1907920
commit 6c5c155311
2 changed files with 45 additions and 51 deletions

View File

@@ -57,12 +57,12 @@ class SubredditPage(BasePage):
"""Open a prompt to search the subreddit"""
name = name or self.content.name
prompt = 'Search this Subreddit: '
search = self.prompt_input(prompt)
if search is not None:
query = self.prompt_input(prompt)
if query is not None:
try:
self.nav.cursor_index = 0
self.content = SubredditContent.from_name(self.reddit, name,
self.loader, search=search)
self.loader, query=query)
except IndexError: # if there are no submissions
show_notification(self.stdscr, ['No results found'])