Skip to content

Commit

Permalink
Readability fixes based on PR review.
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Jan 11, 2022
1 parent 10dd698 commit d9cd3b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions securedrop/journalist_app/col.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion securedrop/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down

0 comments on commit d9cd3b2

Please sign in to comment.