Skip to content

Commit

Permalink
Merge pull request #5932 from freedomofpress/nicer-logo-error
Browse files Browse the repository at this point in the history
Make logo file error nicer
  • Loading branch information
emkll authored May 10, 2021
2 parents 2aec20b + a7d7284 commit 67f77a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion securedrop/journalist_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def manage_config() -> Union[str, werkzeug.Response]:
flash(gettext("Image updated."), "logo-success")
except Exception:
# Translators: This error is shown when an uploaded image cannot be used.
flash(gettext("Unable to process the image file. Try another one."), "logo-error")
flash(
gettext("Unable to process the image file. Please try another one."),
"logo-error"
)
finally:
return redirect(url_for("admin.manage_config") + "#config-logoimage")
else:
Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/test_journalist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ def test_logo_upload_save_fails(config, journalist_app, test_admin, locale):
)

assert page_language(resp.data) == language_tag(locale)
msgids = ["Unable to process the image file. Try another one."]
msgids = ["Unable to process the image file. Please try another one."]
with xfail_untranslated_messages(config, locale, msgids):
ins.assert_message_flashed(gettext(msgids[0]), "logo-error")
finally:
Expand Down

0 comments on commit 67f77a3

Please sign in to comment.