Skip to content

Commit

Permalink
[Proxy] Send back to the client an error in case some exception occur…
Browse files Browse the repository at this point in the history
…s with the Request
  • Loading branch information
afabiani committed Jul 27, 2021
1 parent 8490164 commit eb198a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions geonode/maps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,16 +582,18 @@ def get_legend(self):
capability = dataset_params.get('capability', {})
# Use '' to represent default layer style
style_name = capability.get('style', '')
href = None
dataset_obj = Dataset.objects.filter(alternate=self.name).first()
if ':' in style_name:
style_name = style_name.split(':')[1]
elif dataset_obj.default_style:
style_name = dataset_obj.default_style.name
href = dataset_obj.get_legend_url(style_name=style_name)
style = Style.objects.filter(name=style_name).first()
if style:
# replace map-legend display name if style has a title
style_name = style.sld_title or style_name
if dataset_obj:
if ':' in style_name:
style_name = style_name.split(':')[1]
elif dataset_obj.default_style:
style_name = dataset_obj.default_style.name
href = dataset_obj.get_legend_url(style_name=style_name)
style = Style.objects.filter(name=style_name).first()
if style:
# replace map-legend display name if style has a title
style_name = style.sld_title or style_name
return {style_name: href}
except Exception as e:
logger.exception(e)
Expand Down
2 changes: 1 addition & 1 deletion geonode/proxy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from geonode import geoserver # noqa
from geonode.monitoring import register_event

TIMEOUT = 600
TIMEOUT = 30

LINK_TYPES = [L for L in _LT if L.startswith("OGC:")]

Expand Down

0 comments on commit eb198a8

Please sign in to comment.