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 18, 2013
1 parent e403ba0 commit 21da1ec
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 @@ -249,7 +249,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 @@ -141,7 +141,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 @@ -518,7 +518,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 @@ -862,7 +862,7 @@ def package_show(context, data_dict):
else:
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 @@ -1010,7 +1010,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 @@ -291,7 +291,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 @@ -494,7 +494,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 21da1ec

Please sign in to comment.