Skip to content

Commit

Permalink
Make logo file error nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
rmol committed May 7, 2021
1 parent 4276758 commit a7d7284
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 a7d7284

Please sign in to comment.