Skip to content

Commit

Permalink
Fix exceptions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed May 21, 2024
1 parent 9cf66f9 commit 817b018
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def write_log_message(message, tag, level):
self.dlg.path_training_folder.setStorageMode(QgsFileWidget.GetDirectory)
self.dlg.path_training_folder.setDialogTitle(tr("Choose a folder to store the your data about the training"))

self.dlg.name_training_folder.setPlaceholderText(os.getlogin())
self.dlg.name_training_folder.setPlaceholderText(self.current_login())

self.dlg.download_training_data.clicked.connect(self.download_training_data_clicked)
self.dlg.open_training_folder.clicked.connect(self.open_training_folder_clicked)
Expand Down Expand Up @@ -996,6 +996,13 @@ def filename_changed(self):

self.current_path = new_path

@staticmethod
def current_login() -> str:
try:
return os.getlogin()
except OSError:
return 'repository'

def current_lwc_version(self) -> LwcVersions:
""" Return the current selected LWC version from the server. """
if self._version:
Expand Down Expand Up @@ -5087,7 +5094,7 @@ def open_training_project_clicked(self):
with OverrideCursor(Qt.WaitCursor):
project = QgsProject.instance()
project.read(str(file_path.joinpath(TRAINING_PROJECT)))
project.writeEntry("WMSServiceTitle", "/", os.getlogin())
project.writeEntry("WMSServiceTitle", "/", self.current_login())

def run(self) -> bool:
"""Plugin run method : launch the GUI."""
Expand Down

0 comments on commit 817b018

Please sign in to comment.