Skip to content

Commit

Permalink
KeyError: 'url' during layer upload to GeoNode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gpetrak committed Nov 11, 2024
1 parent 876cef5 commit f26ceee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/qgis_geonode/apiclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BaseGeonodeClient(QtCore.QObject):
style_detail_error_received = QtCore.pyqtSignal([str], [str, int, str])
keyword_list_received = QtCore.pyqtSignal(list)
search_error_received = QtCore.pyqtSignal([str], [str, int, str])
dataset_uploaded = QtCore.pyqtSignal(int)
dataset_uploaded = QtCore.pyqtSignal()
dataset_upload_error_received = QtCore.pyqtSignal([str], [str, int, str])

def __init__(
Expand Down
7 changes: 1 addition & 6 deletions src/qgis_geonode/apiclient/geonode_api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,7 @@ def handle_layer_upload(self, result: bool):
if result:
response_contents = self.network_fetcher_task.response_contents[0]
if response_contents.http_status_code in success_statuses:
deserialized = network.deserialize_json_response(
response_contents.response_body
)
catalogue_url = deserialized["url"]
dataset_pk = catalogue_url.rsplit("/")[-1]
self.dataset_uploaded.emit(int(dataset_pk))
self.dataset_uploaded.emit()
else:
self.dataset_upload_error_received[str, int, str].emit(
response_contents.qt_error,
Expand Down
2 changes: 1 addition & 1 deletion src/qgis_geonode/gui/geonode_map_layer_config_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def upload_layer_to_geonode(self) -> None:
self.layer, allow_public_access=self.public_access_chb.isChecked()
)

def handle_layer_uploaded(self, dataset_pk: int):
def handle_layer_uploaded(self):
self._toggle_upload_controls(enabled=True)
self._show_message("Layer uploaded successfully!")

Expand Down

0 comments on commit f26ceee

Please sign in to comment.