Skip to content

Commit

Permalink
[#1188] Allow empty orgs if datasets can be unowned
Browse files Browse the repository at this point in the history
If the "create_unowned_dataset" is set to True and you are not a
sysadmin and select the "No organization" option on the dataset form,
you get a validation error.
  • Loading branch information
amercader committed Jan 8, 2014
1 parent 6cb9a97 commit 6123e22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/logic/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def owner_org_validator(key, data, errors, context):
model = context['model']
user = context['user']
user = model.User.get(user)
if value == '':
if value == '' :
if new_authz.check_config_permission('create_unowned_dataset'):
return
# only sysadmins can remove datasets from org
if not user.sysadmin:
raise Invalid(_('You cannot remove a dataset from an existing organization'))
Expand Down

0 comments on commit 6123e22

Please sign in to comment.