Skip to content

Commit

Permalink
[Closes #4029] Metadata Download Link for RemoteServices should repor…
Browse files Browse the repository at this point in the history
…t the Service Type instead of a generic 'http-download' (#4030)
  • Loading branch information
Alessio Fabiani authored and capooti committed Oct 29, 2018
1 parent aba1eb7 commit fd8666b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,11 +1032,14 @@ def download_links(self):
elif url.link_type in ('OGC:WMS', 'OGC:WFS', 'OGC:WCS'):
links.append((self.title, url.name, url.link_type, url.url))
else:
_link_type = 'WWW:DOWNLOAD-1.0-http--download'
if self.storeType == 'remoteStore':
_link_type = 'WWW:DOWNLOAD-%s' % self.remote_service.type
description = '%s (%s Format)' % (self.title, url.name)
links.append(
(self.title,
description,
'WWW:DOWNLOAD-1.0-http--download',
_link_type,
url.url))
return links

Expand Down
2 changes: 1 addition & 1 deletion geonode/catalogue/backends/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def extract_links(self, rec):
return None

for link_el in rec.distribution.online:
if link_el.protocol == 'WWW:DOWNLOAD-1.0-http--download':
if 'WWW:DOWNLOAD' in link_el.protocol:
try:
extension = link_el.name.split('.')[-1]
format = format_re.match(link_el.description).groups()[0]
Expand Down

0 comments on commit fd8666b

Please sign in to comment.