Skip to content

Commit 9d3008f

Browse files
committed
address review feedback
1 parent ed2b1c4 commit 9d3008f

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

securedrop_client/db.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,13 @@ def location(self, data_dir: str) -> str:
343343

344344
class DownloadErrorCodes(Enum):
345345
"""
346-
Enumerated download failure modes, with explanation templates as values.
346+
Enumerated download failure modes, with templates as values.
347347
348-
The explanation templates are intended to be formatted with the
349-
class name of a downloadable item.
348+
The templates are intended to be formatted with the class name of
349+
a downloadable item.
350350
"""
351-
CHECKSUM_ERROR = "Downloaded {object_type} was incomplete; it will be retried."
352-
DECRYPTION_ERROR = (
353-
"Downloaded {object_type} could not be decrypted. Administrator action is needed."
354-
)
351+
CHECKSUM_ERROR = "cannot download {object_type}"
352+
DECRYPTION_ERROR = "cannot decrypt {object_type}"
355353

356354

357355
class DownloadError(Base):

securedrop_client/gui/widgets.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,8 @@ class SpeechBubble(QWidget):
18961896
background-color: #fff;
18971897
""",
18981898
"message": """
1899+
min-width: 520px;
1900+
max-width: 520px;
18991901
font-family: 'Source Sans Pro';
19001902
font-weight: 400;
19011903
font-size: 15px;
@@ -1917,6 +1919,8 @@ class SpeechBubble(QWidget):
19171919
background-color: #fff;
19181920
""",
19191921
"message": """
1922+
min-width: 520px;
1923+
max-width: 520px;
19201924
font-family: 'Source Sans Pro';
19211925
font-weight: 400;
19221926
font-size: 15px;
@@ -2001,7 +2005,7 @@ def _update_text(self, source_id: str, message_uuid: str, text: str) -> None:
20012005
"""
20022006
if message_uuid == self.uuid:
20032007
self.message.setText(text)
2004-
self.set_normal_styles()
2008+
self.set_normal_styles()
20052009

20062010
@pyqtSlot(str, str, str)
20072011
def set_error(self, source_uuid: str, uuid: str, text: str):
@@ -2046,6 +2050,8 @@ class ReplyWidget(SpeechBubble):
20462050
border: 0px;
20472051
""",
20482052
"message": """
2053+
min-width: 520px;
2054+
max-width: 520px;
20492055
font-family: 'Source Sans Pro';
20502056
font-weight: 400;
20512057
font-size: 15px;
@@ -2075,6 +2081,8 @@ class ReplyWidget(SpeechBubble):
20752081
border: 0px;
20762082
""",
20772083
"message": """
2084+
min-width: 520px;
2085+
max-width: 520px;
20782086
font-family: 'Source Sans Pro';
20792087
font-weight: 400;
20802088
font-size: 15px;

tests/test_models.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def test_file_with_download_error(session, download_error_codes):
257257
session.commit()
258258

259259
classname = f.__class__.__name__.lower()
260-
assert str(f) == f"Downloaded {classname} was incomplete; it will be retried."
260+
assert str(f) == f"cannot download {classname}"
261261

262262

263263
def test_message_with_download_error(session, download_error_codes):
@@ -269,9 +269,7 @@ def test_message_with_download_error(session, download_error_codes):
269269
session.commit()
270270

271271
classname = m.__class__.__name__.lower()
272-
assert str(m) == (
273-
f"Downloaded {classname} could not be decrypted. Administrator action is needed."
274-
)
272+
assert str(m) == f"cannot decrypt {classname}"
275273

276274

277275
def test_reply_with_download_error(session, download_error_codes):
@@ -283,6 +281,4 @@ def test_reply_with_download_error(session, download_error_codes):
283281
session.commit()
284282

285283
classname = r.__class__.__name__.lower()
286-
assert str(r) == (
287-
f"Downloaded {classname} could not be decrypted. Administrator action is needed."
288-
)
284+
assert str(r) == f"cannot decrypt {classname}"

0 commit comments

Comments
 (0)