Skip to content

Commit

Permalink
[#1400] remove leading _ from validate()
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Dec 19, 2013
1 parent 3313c54 commit f5189ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/plugins.py
Expand Up @@ -233,7 +233,7 @@ def history_template(self):
def package_form(self):
return 'package/new_package_form.html'

def _validate(self, data_dict, schema, context, action):
def validate(self, data_dict, schema, context, action):
"""
Complete control over create/update/show validation.
"""
Expand Down
4 changes: 2 additions & 2 deletions ckan/logic/action/create.py
Expand Up @@ -136,7 +136,7 @@ def package_create(context, data_dict):
# to ensure they still work
package_plugin.check_data_dict(data_dict)

data, errors = package_plugin._validate(
data, errors = package_plugin.validate(
data_dict, schema, context, 'create')
log.debug('package_create validate_errs=%r user=%s package=%s data=%r',
errors, context.get('user'),
Expand Down Expand Up @@ -489,7 +489,7 @@ def _group_or_org_create(context, data_dict, is_org=False):
except TypeError:
group_plugin.check_data_dict(data_dict)

data, errors = group_plugin._validate(
data, errors = group_plugin.validate(
data_dict, schema, context, 'create')
log.debug('group_create validate_errs=%r user=%s group=%s data_dict=%r',
errors, context.get('user'), data_dict.get('name'), data_dict)
Expand Down
4 changes: 2 additions & 2 deletions ckan/logic/action/get.py
Expand Up @@ -790,7 +790,7 @@ def package_show(context, data_dict):
schema = package_plugin.show_package_schema()

if schema and context.get('validate', True):
package_dict, errors = package_plugin._validate(
package_dict, errors = package_plugin.validate(
package_dict, schema, context, 'show')

for item in plugins.PluginImplementations(plugins.IPackageController):
Expand Down Expand Up @@ -911,7 +911,7 @@ def _group_or_org_show(context, data_dict, is_org=False):
{'id': group_dict['id']})

if schema:
group_dict, errors = group_plugin._validate(
group_dict, errors = group_plugin.validate(
group_dict, schema, context, 'show')
return group_dict

Expand Down
4 changes: 2 additions & 2 deletions ckan/logic/action/update.py
Expand Up @@ -282,7 +282,7 @@ def package_update(context, data_dict):
# to ensure they still work.
package_plugin.check_data_dict(data_dict)

data, errors = package_plugin._validate(
data, errors = package_plugin.validate(
data_dict, schema, context, 'update')
log.debug('package_update validate_errs=%r user=%s package=%s data=%r',
errors, context.get('user'),
Expand Down Expand Up @@ -433,7 +433,7 @@ def _group_or_org_update(context, data_dict, is_org=False):
except TypeError:
group_plugin.check_data_dict(data_dict)

data, errors = group_plugin._validate(
data, errors = group_plugin.validate(
data_dict, schema, context, 'update')
log.debug('group_update validate_errs=%r user=%s group=%s data_dict=%r',
errors, context.get('user'),
Expand Down

0 comments on commit f5189ec

Please sign in to comment.