Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced duplicate updater message modal with syslog call #5067

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions journalist_gui/journalist_gui/SecureDropUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pexpect
import socket
import sys
import syslog as log

from journalist_gui import updaterUI, strings, resources_rc # noqa

Expand Down Expand Up @@ -35,9 +36,7 @@ def prevent_second_instance(app: QtWidgets.QApplication, name: str) -> None: #
app.instance_binding.bind(IDENTIFIER)
except OSError as e:
if e.errno == ALREADY_BOUND_ERRNO:
err_dialog = QtWidgets.QMessageBox()
err_dialog.setText(name + strings.app_is_already_running)
err_dialog.exec()
log.syslog(log.LOG_NOTICE, name + strings.app_is_already_running)
sys.exit()
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion journalist_gui/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@mock.patch('journalist_gui.SecureDropUpdater.sys.exit')
@mock.patch('journalist_gui.SecureDropUpdater.QtWidgets.QMessageBox')
@mock.patch('syslog.syslog')
class TestSecondInstancePrevention(unittest.TestCase):
def setUp(self):
self.mock_app = mock.MagicMock()
Expand Down