diff --git a/src/pyoncatqt/login.py b/src/pyoncatqt/login.py index 23de574..a17c0d6 100644 --- a/src/pyoncatqt/login.py +++ b/src/pyoncatqt/login.py @@ -290,9 +290,6 @@ def get_agent_instance(self: QGroupBox) -> pyoncat.ONCat: def connect_to_oncat(self: QGroupBox) -> None: """Connect to OnCat""" - # Check if already connected to OnCat - if self.is_connected: - return self.login_dialog.exec_() self.update_connection_status() diff --git a/tests/test_login_dialog.py b/tests/test_login_dialog.py index c27bb6c..9767864 100644 --- a/tests/test_login_dialog.py +++ b/tests/test_login_dialog.py @@ -140,7 +140,8 @@ def test_is_connected() -> None: assert dialog.is_connected dialog.connect_to_oncat() - assert not dialog.login_dialog.exec_.called + # dialog is always called + assert dialog.login_dialog.exec_.called def test_login_dialog_nominal(qtbot: pytest.fixture) -> None: