Skip to content

Commit

Permalink
Allow dataset creation without adding any resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brooks committed Nov 2, 2018
1 parent 02e65d0 commit 3a4a778
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/controllers/package.py
Expand Up @@ -667,8 +667,8 @@ def new_resource(self, id, data=None, errors=None, error_summary=None):
except NotFound:
abort(404, _('The dataset {id} could not be found.'
).format(id=id))
if not len(data_dict['resources']):
# no data so keep on page
if asbool(config.get('ckan.dataset.create.require.resource', 'True')) and not len(data_dict['resources']):
# no data and configured to require resource so keep on page
msg = _('You must add at least one data resource')
# On new templates do not use flash message

Expand Down
14 changes: 14 additions & 0 deletions doc/maintaining/configuration.rst
Expand Up @@ -1859,6 +1859,20 @@ example.
Form Settings
-------------

.. ckan.dataset.create.require.resource
ckan.dataset.create.require.resource
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Example::

ckan.dataset.create.require.resource = False

Default value: True

If False, there is no need to add any resources when creating a new dataset.


.. _package_new_return_url:

package_new_return_url
Expand Down

0 comments on commit 3a4a778

Please sign in to comment.