Skip to content

Commit

Permalink
Fix bugs in Wikipedia mailer (#487)
Browse files Browse the repository at this point in the history
* Fix broken shellcheck mirror URL

* Update to latest shellcheck release

Co-authored-by: Clemens Wolff <clemens@ascoderu.ca>
  • Loading branch information
adamsclafani and c-w committed Jul 30, 2020
1 parent 0788ff0 commit f5af2b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ RUN wget -q -O /usr/bin/hadolint "https://github.com/hadolint/hadolint/releases/
&& chmod +x /usr/bin/hadolint \
&& hadolint --version

ARG SHELLCHECK_VERSION=v0.7.0
RUN wget -q -O /tmp/shellcheck.tar.xz "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" \
ARG SHELLCHECK_VERSION=v0.7.1
RUN wget -q -O /tmp/shellcheck.tar.xz "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname -m).tar.xz" \
&& tar -xJf /tmp/shellcheck.tar.xz -C /usr/bin --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck" \
&& rm /tmp/shellcheck.tar.xz \
&& shellcheck --version
Expand Down
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

0 comments on commit f5af2b2

Please sign in to comment.