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

Make logo file error nicer #5932

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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