Skip to content

Commit

Permalink
Improve compatibility with GeoNode 3.3.1 (GeoNode#209)
Browse files Browse the repository at this point in the history
Improve compatibility with GeoNode 3.3.1

Also fix metadata download error that was being caused by the api client object being deleted

fixes GeoNode#210
fixes GeoNode#199
  • Loading branch information
Ricardo Garcia Silva authored Jan 12, 2022
1 parent fd6e55a commit 5657562
Show file tree
Hide file tree
Showing 8 changed files with 708 additions and 301 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
ci:
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
image: qgis/qgis:release-3_18
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
image: qgis/qgis:release-3_18
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebuild-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
rebuild-docs:
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
image: qgis/qgis:release-3_18
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
create-release:
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
image: qgis/qgis:release-3_18
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
needs: create-release
runs-on: ubuntu-20.04
container:
image: qgis/qgis:release-3_16
image: qgis/qgis:release-3_18
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
11 changes: 6 additions & 5 deletions src/qgis_geonode/apiclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,22 @@ def handle_dataset_style(
raise NotImplementedError

def get_dataset_detail(
self, brief_dataset: models.BriefDataset, get_style_too: bool = False
self,
dataset: typing.Union[models.BriefDataset, models.Dataset],
get_style_too: bool = False,
) -> None:
requests_to_perform = [
network.RequestToPerform(url=self.get_dataset_detail_url(brief_dataset.pk))
network.RequestToPerform(url=self.get_dataset_detail_url(dataset.pk))
]
if get_style_too:
is_vector = (
brief_dataset.dataset_sub_type
== models.GeonodeResourceType.VECTOR_LAYER
dataset.dataset_sub_type == models.GeonodeResourceType.VECTOR_LAYER
)
should_load_vector_style = (
models.ApiClientCapability.LOAD_VECTOR_LAYER_STYLE in self.capabilities
)
if is_vector and should_load_vector_style:
sld_url = QtCore.QUrl(brief_dataset.default_style.sld_url)
sld_url = QtCore.QUrl(dataset.default_style.sld_url)
requests_to_perform.append(network.RequestToPerform(url=sld_url))

self.network_fetcher_task = network.NetworkRequestTask(
Expand Down
Loading

0 comments on commit 5657562

Please sign in to comment.