Skip to content

Commit

Permalink
A resource is allowed to have null value in its url. We don't set res…
Browse files Browse the repository at this point in the history
…ource['url'] as 'http://' after the resource is retrieved from the database. In this way, the value of resource['url'] is kept as null at front end. We have tested the update with the others in the same branch using the default web UI front. For a resuouce with an empty url, in the Resource Page , the line for URL and the Go to resource Button are not displayed. In the Package page, the Go to resource button is not included in the Explore pop up menu. There is no extra log message shown up in the console.
  • Loading branch information
yingqiaogit committed Apr 29, 2016
1 parent 9c0050b commit e03da49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/dictization/model_dictize.py
Expand Up @@ -113,7 +113,7 @@ def resource_dictize(res, context):
resource_id=res.id,
filename=cleaned_name,
qualified=True)
elif not urlparse.urlsplit(url).scheme and not context.get('for_edit'):
elif resource['url'] and not urlparse.urlsplit(url).scheme and not context.get('for_edit'):
resource['url'] = u'http://' + url.lstrip('/')
return resource

Expand Down

0 comments on commit e03da49

Please sign in to comment.