From 1a8709debf5d6b4e89162cc8a38c912585d2d376 Mon Sep 17 00:00:00 2001 From: John Glover Date: Tue, 24 Jul 2012 17:12:26 +0100 Subject: [PATCH] Bug fix: records field can be empty. --- ckanext/datastore/logic/action/create.py | 2 +- ckanext/datastore/logic/schema.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ckanext/datastore/logic/action/create.py b/ckanext/datastore/logic/action/create.py index c7e02d70237..da6491b0e63 100644 --- a/ckanext/datastore/logic/action/create.py +++ b/ckanext/datastore/logic/action/create.py @@ -30,7 +30,7 @@ def datastore_create(context, data_dict): model = _get_or_bust(context, 'model') resource_id = _get_or_bust(data_dict, 'resource_id') fields = data_dict.get('fields') - records = _get_or_bust(data_dict, 'records') + records = data_dict.get('records') _check_access('datastore_create', context, data_dict) diff --git a/ckanext/datastore/logic/schema.py b/ckanext/datastore/logic/schema.py index b8aaa29b6df..595d753d169 100644 --- a/ckanext/datastore/logic/schema.py +++ b/ckanext/datastore/logic/schema.py @@ -14,6 +14,7 @@ def default_fields_schema(): def default_datastore_create_schema(): + # TODO: resource_id should have a resource_id_exists validator return { 'resource_id': [not_missing, not_empty, unicode], 'fields': default_fields_schema(),