Skip to content

Commit

Permalink
add_whether_on_same_domain on not private by convention any more
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Nov 24, 2012
1 parent d9554bb commit 48eca99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckan/controllers/package.py
Expand Up @@ -1337,7 +1337,7 @@ def resource_datapreview(self, id, resource_id):
c.package = get_action('package_show')(context, {'id': id})

data_dict = {'resource': c.resource, 'package': c.package}
data_dict = h._add_whether_on_same_domain(data_dict)
data_dict = h.add_whether_on_same_domain(data_dict)

plugins = p.PluginImplementations(p.IResourcePreview)
plugins_that_can_preview = [plugin for plugin in plugins if plugin.can_preview(data_dict)]
Expand Down
4 changes: 2 additions & 2 deletions ckan/lib/helpers.py
Expand Up @@ -1281,7 +1281,7 @@ def _compare_domains(urls):
return len(domains) == 1


def _add_whether_on_same_domain(data_dict):
def add_whether_on_same_domain(data_dict):
''' sets the ``on_same_domain`` flag to a resource dictionary
to true if the resource is on the ckan instance domain
'''
Expand All @@ -1303,7 +1303,7 @@ def _can_be_previewed(data_dict):
The resource dict has to have a value for ``on_same_domain``
:type data_dict: dictionary
'''
data_dict = _add_whether_on_same_domain(data_dict)
data_dict = add_whether_on_same_domain(data_dict)
plugins = p.PluginImplementations(p.IResourcePreview)
return any(plugin.can_preview(data_dict) for plugin in plugins)

Expand Down

0 comments on commit 48eca99

Please sign in to comment.