From d9cd3b280ff79241bedda966e776c99944452f46 Mon Sep 17 00:00:00 2001 From: Kevin O'Gorman Date: Tue, 11 Jan 2022 10:23:52 -0500 Subject: [PATCH] Readability fixes based on PR review. --- securedrop/journalist_app/col.py | 4 ++-- securedrop/store.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/securedrop/journalist_app/col.py b/securedrop/journalist_app/col.py index a6ed6d9c633..324ef16567c 100644 --- a/securedrop/journalist_app/col.py +++ b/securedrop/journalist_app/col.py @@ -138,8 +138,8 @@ def download_single_file(filesystem_id: str, fn: str) -> werkzeug.Response: reply = Reply.query.filter(Reply.filename == fn).one() mark_seen([reply], journalist) elif fn.endswith("-doc.gz.gpg") or fn.endswith("doc.zip.gpg"): - the_file = Submission.query.filter(Submission.filename == fn).one() - mark_seen([the_file], journalist) + submitted_file = Submission.query.filter(Submission.filename == fn).one() + mark_seen([submitted_file], journalist) else: message = Submission.query.filter(Submission.filename == fn).one() mark_seen([message], journalist) diff --git a/securedrop/store.py b/securedrop/store.py index 0a038113918..5e37f1786a2 100644 --- a/securedrop/store.py +++ b/securedrop/store.py @@ -332,9 +332,10 @@ def save_file_submission(self, filename: typing.Optional[str], stream: 'IO[bytes]') -> str: - sanitized_filename = secure_filename("unknown.file") if filename is not None: sanitized_filename = secure_filename(filename) + else: + sanitized_filename = secure_filename("unknown.file") # We store file submissions in a .gz file for two reasons: #