Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4827 - Line layer uploaded to GeoNode is rendered as a point layer #4837

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions geonode/geoserver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,14 @@ def get_sld_for(gs_catalog, layer):
traceback.print_exc()
pass

if _default_style is None:
try:
gs_catalog._cache.clear()
gs_layer = gs_catalog.get_layer(layer.name)
except BaseException:
traceback.print_exc()

if _default_style is None:
try:
gs_layer = gs_catalog.get_layer(layer.name)
name = gs_layer.default_style.name if gs_layer.default_style is not None else "raster"
except BaseException:
traceback.print_exc()
Expand All @@ -260,6 +264,7 @@ def get_sld_for(gs_catalog, layer):
name = _default_style.name

# Detect geometry type if it is a FeatureType

if gs_layer and gs_layer.resource and gs_layer.resource.resource_type == 'featureType':
res = gs_layer.resource
res.fetch()
Expand Down