diff --git a/securedrop_client/storage.py b/securedrop_client/storage.py index b44db9592..95aae3019 100644 --- a/securedrop_client/storage.py +++ b/securedrop_client/storage.py @@ -76,10 +76,8 @@ def get_remote_data(api: API) -> Tuple[List[SDKSource], List[SDKSubmission], Lis (remote_sources, remote_submissions, remote_replies) """ - remote_submissions = [] # type: List[SDKSubmission] remote_sources = api.get_sources() - for source in remote_sources: - remote_submissions.extend(api.get_submissions(source)) + remote_submissions = api.get_all_submissions() remote_replies = api.get_all_replies() logger.info('Fetched {} remote sources.'.format(len(remote_sources))) diff --git a/tests/test_storage.py b/tests/test_storage.py index 729b4ad4d..55408a0e1 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -121,7 +121,7 @@ def test_get_remote_data(mocker): source = make_remote_source() mock_api.get_sources.return_value = [source, ] submission = mocker.MagicMock() - mock_api.get_submissions.return_value = [submission, ] + mock_api.get_all_submissions.return_value = [submission, ] reply = mocker.MagicMock() mock_api.get_all_replies.return_value = [reply, ] sources, submissions, replies = get_remote_data(mock_api)