Skip to content

Commit

Permalink
Merge pull request #5067 from zenmonkeykstop/4878-updater-suppress-du…
Browse files Browse the repository at this point in the history
…pe-modal

Replaced duplicate updater message modal with syslog call
  • Loading branch information
rmol authored Dec 10, 2019
2 parents be65fd5 + 432343c commit c128349
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit c128349

Please sign in to comment.