Skip to content

Commit

Permalink
question
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed May 20, 2019
1 parent fd6b8b7 commit 25c63ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
10 changes: 5 additions & 5 deletions securedrop_client/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,13 @@ def on_submission_download(
self.on_action_requiring_login()
return

sdk_object = sdclientapi.Submission(uuid=submission.uuid)
sdk_object.filename = submission.filename
sdk_object.source_uuid = source_db_object.uuid
sdk_submission = sdclientapi.Submission(uuid=submission.uuid)
sdk_submission.filename = submission.filename
sdk_submission.source_uuid = source_db_object.uuid

job = DownloadSubmissionJob(sdk_object, self.data_dir, submission)
job = DownloadSubmissionJob(sdk_submission, self.data_dir)
self.api_job_queue.enqueue(job)
self.set_status(_('Downloading {}'.format(sdk_object.filename)))
self.set_status(_('Downloading {}'.format(sdk_submission.filename)))

def on_file_download_success(self, result, current_object):
"""
Expand Down
9 changes: 2 additions & 7 deletions securedrop_client/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,8 @@ def handle_failure(self, exception: Exception) -> None:

class DownloadSubmissionJob(ApiJob):

def __init__(
self,
submission: sdclientapi.Submission,
data_dir: str,
db_object: Union[File, Message],
) -> None:
def __init__(self, submission: sdclientapi.Submission, data_dir: str) -> None:
super().__init__([submission, data_dir], {})
self.__db_object = db_object

def call_api(self, api_client: API, nargs: list, kwargs: dict) -> Any:
return api_client.download_submission(*nargs, **kwargs)
Expand Down Expand Up @@ -86,6 +80,7 @@ def start(self, test_loop: bool = False) -> None:
self.last_job = None

try:
print('self.api_client: {}'.format(self.api_client)) # why is self.api_client None?
job._do_call_api(self.api_client)
except RequestTimeoutError:
self.run = False
Expand Down

0 comments on commit 25c63ee

Please sign in to comment.