Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wikipedia mailer bug fixes #487

Merged
merged 3 commits into from
Jul 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions opwen_email_server/mailers/wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __call__(self, email: dict) -> dict:
self._language_setter('en')

try:
wiki_page = self._page_fetch(email['body'])
wiki_page = self._page_fetch(email['body'].strip())
except DisambiguationError as e:
subject = 'Suggested Searches'
body = 'Multiple results found. Try again with the following: \n{}'.format('\n'.join(e.options))
Expand All @@ -48,7 +48,7 @@ def __call__(self, email: dict) -> dict:
body = 'No results found for: {}'.format(email['body'])
else:
subject = wiki_page.title
body = ''
body = 'Results found'
download_link = self._get_download_link(wiki_page.url)
pdf_file = get(download_link)
email['attachments'] = [{
Expand Down