Skip to content

Commit

Permalink
- Filter Remote Services Links to the REST MAP
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Nov 9, 2018
1 parent 63a9137 commit 62601dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 9 additions & 9 deletions geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,27 +1040,27 @@ def set_bounds_from_bbox(self, bbox, srid):
def download_links(self):
"""assemble download links for pycsw"""
links = []
for url in self.link_set.all():
if url.link_type == 'metadata': # avoid recursion
for link in self.link_set.all():
if link.link_type == 'metadata': # avoid recursion
continue
if url.link_type == 'html':
if link.link_type == 'html':
links.append(
(self.title,
'Web address (URL)',
'WWW:LINK-1.0-http--link',
url.url))
elif url.link_type in ('OGC:WMS', 'OGC:WFS', 'OGC:WCS'):
links.append((self.title, url.name, url.link_type, url.url))
link.url))
elif link.link_type in ('OGC:WMS', 'OGC:WFS', 'OGC:WCS'):
links.append((self.title, link.name, link.link_type, link.url))
else:
_link_type = 'WWW:DOWNLOAD-1.0-http--download'
if self.storeType == 'remoteStore':
if self.storeType == 'remoteStore' and link.extension in ('html'):
_link_type = 'WWW:DOWNLOAD-%s' % self.remote_service.type
description = '%s (%s Format)' % (self.title, url.name)
description = '%s (%s Format)' % (self.title, link.name)
links.append(
(self.title,
description,
_link_type,
url.url))
link.url))
return links

def get_tiles_url(self):
Expand Down
5 changes: 4 additions & 1 deletion geonode/geoserver/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def geoserver_post_save(instance, sender, **kwargs):
payload = json_serializer_producer(instance_dict)
producer.geoserver_upload_layer(payload)
logger.info("... Creating Thumbnail for Layer [%s]" % (instance.alternate))
create_gs_thumbnail(instance, overwrite=True, check_bbox=True)
try:
create_gs_thumbnail(instance, overwrite=True, check_bbox=True)
except BaseException:
logger.warn("!WARNING! - Failure while Creating Thumbnail for Layer [%s]" % (instance.alternate))


def geoserver_post_save_local(instance, *args, **kwargs):
Expand Down

0 comments on commit 62601dd

Please sign in to comment.