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
Comments
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 |
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. |
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. |
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. |
yes that's right, I've got this half done in a branch somewhere, I should clean it up and submit a pr |
@joetsoi do you still have this change in a branch somewhere? |
This issue was closed due to inactivity. Feel free to reopen if you have more feedback or are interested it working on it |
This is a breaking change to the
group_update
andorganization_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
The text was updated successfully, but these errors were encountered: