diff --git a/ckanext/bulkupload/templates/test.html b/ckanext/bulkupload/templates/test.html index 9626075..3169b45 100644 --- a/ckanext/bulkupload/templates/test.html +++ b/ckanext/bulkupload/templates/test.html @@ -5,7 +5,7 @@ {% block form %}

- {{ form.input('name', id='field-dataset-name', label=_('Dataset Name'), value="", error="", placeholder='eg. TransX data') }} + {{ form.input('title', id='field-dataset-title', label=_('Dataset Title'), value="", error="", placeholder='eg. TransX data') }}
{{ form.info('The name of the dataset') }}
{{ form.input('date-start', type='date', id='field-date-start', label=_('Date start'), value='', error='') }}
{{ form.info('Date start') }}
diff --git a/ckanext/bulkupload/views.py b/ckanext/bulkupload/views.py index d58569f..3203128 100644 --- a/ckanext/bulkupload/views.py +++ b/ckanext/bulkupload/views.py @@ -157,11 +157,13 @@ def busoperator(): form_data = clean_dict( dict_fns.unflatten(tuplize_dict(parse_params(tk.request.form))) ) - + name_validated = form_data['title'].replace(' ', '-').lower() + data_dict = { - 'name': form_data['name'], - 'title': form_data['name'], + 'name': name_validated, + 'title': form_data['title'], 'private': False, + 'status': 'active', } x = tk.get_action("package_create")(context, data_dict)