Repository: freedomofpress/securedrop

Issue:
Typo in string, useless error message.
# Bug

There is a typo in one of the strings and also normal users can't check the application logs, so why do we even tell them to?

Found by @xella

## Actual Behavior

> An unexpected error occurred! Please check the application logs or inform your adminstrator.

## Expected Behavior

> An unexpected error occurred! Please inform your administrator.



Discussion:

Resolving patch:
diff --git a/securedrop/journalist.py b/securedrop/journalist.py
--- a/securedrop/journalist.py
+++ b/securedrop/journalist.py
@@ -218,7 +218,7 @@ def admin_add_user():
                 else:
                     flash(gettext("An error occurred saving this user"
                                   " to the database."
-                                  " Please check the application logs."),
+                                  " Please inform your administrator."),
                           "error")
                     app.logger.error("Adding user '{}' failed: {}".format(
                         username, e))
@@ -286,8 +286,7 @@ def admin_reset_two_factor_hotp():
             else:
                 flash(gettext(
                     "An unexpected error occurred! "
-                    "Please check the application "
-                    "logs or inform your adminstrator."), "error")
+                    "Please inform your administrator."), "error")
                 app.logger.error(
                     "set_hotp_secret '{}' (id {}) failed: {}".format(
                         otp_secret, uid, e))
@@ -310,8 +309,8 @@ def commit_account_changes(user):
             db_session.commit()
         except Exception as e:
             flash(gettext(
-                "An unexpected error occurred! Please check the application "
-                  "logs or inform your adminstrator."), "error")
+                "An unexpected error occurred! Please "
+                  "inform your administrator."), "error")
             app.logger.error("Account changes for '{}' failed: {}".format(user,
                                                                           e))
             db_session.rollback()
@@ -718,8 +717,8 @@ def reply():
         db_session.commit()
     except Exception as exc:
         flash(gettext(
-            "An unexpected error occurred! Please check the application "
-            "logs or inform your adminstrator."), "error")
+            "An unexpected error occurred! Please "
+            "inform your administrator."), "error")
         # We take a cautious approach to logging here because we're dealing
         # with responses to sources. It's possible the exception message could
         # contain information we don't want to write to disk.


Test patch:
diff --git a/securedrop/tests/test_journalist.py b/securedrop/tests/test_journalist.py
--- a/securedrop/tests/test_journalist.py
+++ b/securedrop/tests/test_journalist.py
@@ -84,8 +84,8 @@ def test_reply_error_flashed_message(self):
                              data={'filesystem_id': filesystem_id, 'msg': '_'})
 
         self.assertMessageFlashed(
-            'An unexpected error occurred! Please check '
-            'the application logs or inform your adminstrator.', 'error')
+            'An unexpected error occurred! Please '
+            'inform your administrator.', 'error')
 
     def test_empty_replies_are_rejected(self):
         source, _ = utils.db_helper.init_source()
@@ -452,8 +452,7 @@ def test_admin_resets_user_hotp_error(self,
 
         self.assertEqual(old_hotp, new_hotp)
         self.assertMessageFlashed("An unexpected error occurred! "
-                                  "Please check the application "
-                                  "logs or inform your adminstrator.", "error")
+                                  "Please inform your administrator.", "error")
         mocked_error_logger.assert_called_once_with(
             "set_hotp_secret '{}' (id {}) failed: {}".format(
                 otp_secret, self.user.id, error_message))
@@ -612,7 +611,7 @@ def test_admin_add_user_integrity_error(self,
             "None [SQL: 'STATEMENT'] [parameters: 'PARAMETERS']")
         self.assertMessageFlashed(
             "An error occurred saving this user to the database."
-            " Please check the application logs.",
+            " Please inform your administrator.",
             "error")
 
     def test_admin_page_restriction_http_gets(self):