Skip to content

Commit

Permalink
Merge branch 'howff-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Dec 14, 2018
2 parents b050976 + e09df0b commit 8f0cb74
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ckan/controllers/package.py
Expand Up @@ -667,8 +667,12 @@ 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
require_resources = asbool(
config.get('ckan.dataset.create_on_ui_requires_resources',
'True')
)
if require_resources and not len(data_dict['resources']):
# no data and configured to require resource: stay on page
msg = _('You must add at least one data resource')
# On new templates do not use flash message

Expand Down
13 changes: 13 additions & 0 deletions doc/maintaining/configuration.rst
Expand Up @@ -1918,6 +1918,19 @@ example.
Form Settings
-------------

.. ckan.dataset.create_on_ui_requires_resources
ckan.dataset.create_on_ui_requires_resources
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Example::
ckan.dataset.create_on_ui_requires_resources = 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 8f0cb74

Please sign in to comment.