Skip to content

Commit

Permalink
Fix "already implemented" error.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Jan 27, 2016
1 parent 743527a commit a45c2e9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions ckanext/qa/plugin.py
Expand Up @@ -65,17 +65,28 @@ def register_reports(self):
# IActions

def get_actions(self):
return get_functions(action)
return {
'qa_resource_show': action.qa_resource_show,
'qa_package_openness_show': action.qa_package_openness_show,
}

# IAuthFunctions

def get_auth_functions(self):
return get_functions(auth)
return {
'qa_resource_show': auth.qa_resource_show,
'qa_package_openness_show': auth.qa_package_openness_show,
}

# ITemplateHelpers

def get_helpers(self):
return get_functions(helpers)
return {
'qa_openness_stars_resource_html':
helpers.qa_openness_stars_resource_html,
'qa_openness_stars_dataset_html':
helpers.qa_openness_stars_dataset_html,
}

# IPackageController

Expand All @@ -102,10 +113,3 @@ def after_show(self, context, pkg_dict):
del qa_dict['package_id']
del qa_dict['resource_id']
res['qa'] = qa_dict


def get_functions(module):
return dict((name, function) for name, function
in module.__dict__.items()
if isinstance(function, types.FunctionType)
and name[0] != '_')

0 comments on commit a45c2e9

Please sign in to comment.