Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group and org update: treat missing 'users' key as "don't change" #1907

Closed
wardi opened this issue Sep 4, 2014 · 7 comments
Closed

group and org update: treat missing 'users' key as "don't change" #1907

wardi opened this issue Sep 4, 2014 · 7 comments
Assignees

Comments

@wardi
Copy link
Contributor

wardi commented Sep 4, 2014

This is a breaking change to the group_update and organization_update APIs for anyone that relies on clearing the list of users in organizations and groups, but enables the much more common use of changing some organization fields without changing the list of users.

There is currently a workaround in the ckanapi cli that allows this behaviour when running 'ckanapi load organizations ..' from a master list.

Raised by @joetsoi yesterday

@joetsoi
Copy link
Contributor

joetsoi commented Sep 4, 2014

so I think we'd be able to fix this just by changing the default for 'allow_partial_update' to be True here. But allow_partial_update occurs a few more times throughout the model_save.py, and it would be worth considering whether we should change all of them, just one or determine whether as an api user you would expect them to be removed in each case

At the very least 'allow_partial_update' needs to be added to the 'config file options' in the docs

@wardi
Copy link
Contributor Author

wardi commented Sep 4, 2014

allow_partial_update makes no sense the way it is implemented. It applies to some fields and not others, with no obvious pattern. Also it's implemented as a system-wide configuration option! I can't imagine how it could be used in a safe way.

@joetsoi
Copy link
Contributor

joetsoi commented Sep 4, 2014

There's also prevent_packages_update which is basically does the same thing for orgs but not groups, but it seems to have been added back when the group edit form let you directly add/remove packages, but that is now commented out.

@joetsoi joetsoi self-assigned this Sep 11, 2014
@davidread
Copy link
Contributor

I'd support a breaking change. So if you really want to clear a list of users then you'd just have to ensure you still specify a 'user' key but with no value - is that right? It seems straightforward enough.

@joetsoi
Copy link
Contributor

joetsoi commented Oct 3, 2014

yes that's right, I've got this half done in a branch somewhere, I should clean it up and submit a pr

@amercader amercader added this to the CKAN 2.4 milestone Oct 22, 2014
@wardi
Copy link
Contributor Author

wardi commented Oct 23, 2015

@joetsoi do you still have this change in a branch somewhere?

@TkTech TkTech closed this as completed May 10, 2016
@davidread
Copy link
Contributor

This issue was closed due to inactivity. Feel free to reopen if you have more feedback or are interested it working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants