Skip to content

Commit

Permalink
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions python/plugins/MetaSearch/dialogs/maindialog.py
Original file line number Diff line number Diff line change
@@ -863,8 +863,8 @@ def show_metadata(self):
cat = get_catalog_service(self.catalog_url, # spellok
catalog_type=self.catalog_type,
timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password,
username=self.catalog_username or None,
password=self.catalog_password or None,
auth=auth)
record = cat.get_record(identifier)
if cat.type == 'OGC API - Records':
@@ -957,8 +957,8 @@ def _get_catalog(self):
try:
self.catalog = get_catalog_service(
self.catalog_url, catalog_type=self.catalog_type,
timeout=self.timeout, username=self.catalog_username,
password=self.catalog_password, auth=auth)
timeout=self.timeout, username=self.catalog_username or None,
password=self.catalog_password or None, auth=auth)
return True
except Exception as err:
msg = self.tr('Error connecting to service: {0}').format(err)
10 changes: 8 additions & 2 deletions python/plugins/MetaSearch/dialogs/newconnectiondialog.py
Original file line number Diff line number Diff line change
@@ -94,8 +94,14 @@ def accept(self):
self.settings.setValue(keyurl, conn_url)
self.settings.setValue('/MetaSearch/selected', conn_name)

self.settings.setValue('%s/username' % key, conn_username)
self.settings.setValue('%s/password' % key, conn_password)
if conn_username != '':
self.settings.setValue('%s/username' % key, conn_username)
else:
self.settings.remove('%s/username' % key)
if conn_password != '':
self.settings.setValue('%s/password' % key, conn_password)
else:
self.settings.remove('%s/password' % key)

self.settings.setValue('%s/catalog-type' % key, conn_catalog_type)

0 comments on commit 29b40e4

Please sign in to comment.