diff --git a/CHANGES.rst b/CHANGES.rst index 402a73607..f659b6200 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ Changelog ========= + +Version 9.3.1 +~~~~~~~~~~~~~ +Bug fix release: + +All changes: +https://github.com/Open-MSS/MSS/milestone/110?closed=1 + Version 9.3.0 ~~~~~~~~~~~~~ Bug fix release and minor enhancements: diff --git a/conftest.py b/conftest.py index 13a0a5528..b8e92b9d5 100644 --- a/conftest.py +++ b/conftest.py @@ -155,7 +155,7 @@ def generate_initial_config(): SQLALCHEMY_DB_URI = 'sqlite:///' + urljoin(DATA_DIR, 'mscolab.db') # enable SQLALCHEMY_ECHO -SQLALCHEMY_ECHO = True +SQLALCHEMY_ECHO = False # mscolab file upload settings UPLOAD_FOLDER = fs.path.join(DATA_DIR, 'uploads') diff --git a/docs/development.rst b/docs/development.rst index 266575387..798631bf8 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -420,7 +420,7 @@ Command-Line Commands for Keyring 1. **Set a Password** Store a password for a specific service and user: - + .. code-block:: bash keyring set SERVICE_NAME USERNAME @@ -434,7 +434,7 @@ Command-Line Commands for Keyring - Case 2: Custom Authentication Service .. code-block:: bash - + keyring set MSCOLAB_AUTH_http://localhost:8083 mscolab - The command will securely prompt you to input a password (e.g., `example_password`). @@ -479,7 +479,7 @@ Command-Line Commands for Keyring .. code-block:: bash keyring delete http://localhost:8083 myname@mydomain - + - Case 2: Custom Authentication Service .. code-block:: bash @@ -490,7 +490,7 @@ Command-Line Commands for Keyring .. code-block:: bash keyring get MSCOLAB_AUTH_http://localhost:8083 mscolab - + Changing the database model --------------------------- diff --git a/mslib/msui/msui_mainwindow.py b/mslib/msui/msui_mainwindow.py index 3448d75ca..22b6c6675 100644 --- a/mslib/msui/msui_mainwindow.py +++ b/mslib/msui/msui_mainwindow.py @@ -694,14 +694,15 @@ def handle_import_local(self, extension, function, pickertype): self.last_save_directory, f"Flight Track (*.{extension});;All files (*.*)", pickertype=pickertype) + if filenames is None: + return if self.local_active: - if filenames is not None: - activate = True - if len(filenames) > 1: - activate = False - for name in filenames: - self.create_new_flight_track(filename=name, function=function, activate=activate) - self.last_save_directory = fs.path.dirname(name) + activate = True + if len(filenames) > 1: + activate = False + for name in filenames: + self.create_new_flight_track(filename=name, function=function, activate=activate) + self.last_save_directory = fs.path.dirname(name) else: for name in filenames: self.mscolab.handle_import_msc(name, extension, function, pickertype) diff --git a/mslib/version.py b/mslib/version.py index 9324b7bd5..8e876503b 100644 --- a/mslib/version.py +++ b/mslib/version.py @@ -24,4 +24,4 @@ See the License for the specific language governing permissions and limitations under the License. """ -__version__ = u'9.3.0' +__version__ = u'9.3.1' diff --git a/tests/_test_msui/test_mscolab.py b/tests/_test_msui/test_mscolab.py index ad00b1ec2..8b6c599fa 100644 --- a/tests/_test_msui/test_mscolab.py +++ b/tests/_test_msui/test_mscolab.py @@ -599,6 +599,22 @@ def test_import_file(self, name, qtbot): imported_wp = self.window.mscolab.waypoints_model assert len(imported_wp.waypoints) == name[2] + def test_none_import_file(self, qtbot): + with mock.patch("mslib.msui.msui_mainwindow.get_open_filenames", return_value=None) as mockopen: + self._connect_to_mscolab(qtbot) + modify_config_file({"MSS_auth": {self.url: self.userdata[0]}}) + self._login(qtbot, emailid=self.userdata[0], password=self.userdata[2]) + self._activate_operation_at_index(0) + wp = self.window.mscolab.waypoints_model + assert len(wp.waypoints) == 2 + for action in self.window.menuImportFlightTrack.actions(): + if action.objectName() == "actionImportFlightTrackFTML": + action.trigger() + break + assert mockopen.call_count == 1 + imported_wp = self.window.mscolab.waypoints_model + assert len(imported_wp.waypoints) == 2 + def test_work_locally_toggle(self, qtbot): self._connect_to_mscolab(qtbot) modify_config_file({"MSS_auth": {self.url: self.userdata[0]}})