Skip to content

Commit

Permalink
Fix PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Dec 14, 2018
1 parent 8eb7fc9 commit e09df0b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ckan/controllers/package.py
Expand Up @@ -667,9 +667,11 @@ 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 asbool(config.get(
'ckan.dataset.create_on_ui_requires_resources', 'True')) \
and not len(data_dict['resources']):
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

0 comments on commit e09df0b

Please sign in to comment.