Skip to content

Commit

Permalink
[#880] Use the new helper for filestore urls
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelbabu committed Aug 19, 2013
1 parent 1459ac4 commit 24988e9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckan/lib/dictization/model_dictize.py
Expand Up @@ -139,9 +139,14 @@ def resource_dictize(res, context):
resource['tracking_summary'] = tracking
resource['format'] = _unified_resource_format(res.format)
# some urls do not have the protocol this adds http:// to these
# if they are not of url_type filestore
url = resource['url']
if not urlparse.urlsplit(url).scheme:
if (not urlparse.urlsplit(url).scheme and resource['url_type'] !=
'filestore'):
resource['url'] = u'http://' + url.lstrip('/')
# for filestore urls, generate the full urls to keep API consistent
if resource['url_type'] == 'filestore':
h.filestore_url_convert(resource, qualified=True)
return resource

def related_dictize(rel, context):
Expand Down

0 comments on commit 24988e9

Please sign in to comment.