Skip to content

Commit

Permalink
[#1473] allow empty string in owner org when there is no previous pac…
Browse files Browse the repository at this point in the history
…kage or owner org
  • Loading branch information
kindly authored and amercader committed Jan 29, 2014
1 parent dddd654 commit a6bd03b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/logic/validators.py
Expand Up @@ -35,8 +35,9 @@ def owner_org_validator(key, data, errors, context):
if value == '' :
if not new_authz.check_config_permission('create_unowned_dataset'):
raise Invalid(_('A organization must be supplied'))
package = context.get('package')
# only sysadmins can remove datasets from org
if not user.sysadmin:
if package and package.owner_org and not user.sysadmin:
raise Invalid(_('You cannot remove a dataset from an existing organization'))
return

Expand Down

0 comments on commit a6bd03b

Please sign in to comment.