Skip to content

Commit

Permalink
Merge pull request #626 from freedomofpress/bugfix-577
Browse files Browse the repository at this point in the history
bugfix: populate source list immediately upon login (#577)
  • Loading branch information
kushaldas authored Nov 20, 2019
2 parents c673d50 + 07713fc commit cb9102e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions securedrop_client/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def on_authenticate_success(self, result):
self.api.journalist_last_name,
self.session)
self.gui.show_main_window(user)
self.update_sources()
self.sync_api()
self.api_job_queue.login(self.api)
self.is_authenticated = True
Expand Down
2 changes: 2 additions & 0 deletions tests/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def test_Controller_on_authenticate_success(homedir, config, mocker, session_mak
mock_api_job_queue = mocker.patch("securedrop_client.logic.ApiJobQueue")
co = Controller('http://localhost', mock_gui, session_maker, homedir)
co.sync_api = mocker.MagicMock()
co.update_sources = mocker.MagicMock()
co.session.add(user)
co.session.commit()
co.api = mocker.MagicMock()
Expand All @@ -211,6 +212,7 @@ def test_Controller_on_authenticate_success(homedir, config, mocker, session_mak
co.sync_api.assert_called_once_with()
assert co.is_authenticated
assert mock_api_job_queue.called
co.update_sources.assert_called_once_with()
login.assert_called_with(co.api)
co.resume_queues.assert_called_once_with()

Expand Down

0 comments on commit cb9102e

Please sign in to comment.