[ckan-dev] Problem removing datasets from a group through API

Sean Hammond sean.hammond at okfn.org
Tue Apr 3 12:08:51 UTC 2012


> Hello,
> I ran into following issue today.
> 
> Whenever I add datasets to a Group, lets call it 'mygroup', using
> API v2 it works fine, but when I try to remove datasets from a
> group, there are some issues. When I go to /group it shows the right
> amount of datasets in group listing. But, at /group/mygroup also
> shows those groups I just removed.
> 
> Here is step by step what I did.
> - I POSTed json: {'packages': ['pkg_id1', 'pkg_id2']} to my
> controller (group_id I'll get from GET -parameters) which in turn
> calls api.update(register='group', ver=2, id=group_id). This added
> datasets to 'mygroup' and everything was fine upon inspection.
> - Now, I did the same thing as previously, but my json was as
> follows: {'packages': ['pkg_id2']}. This should have, in theory
> removed, 'pkg_id1' from mygroup.
> - /group listed 'mygroup' as having 1 dataset. But, /group/mygroup
> listed both datasets I first added to 'mygroup'. Also, edit of
> 'pkg_id1' shows that it belongs to 'mygroup', but allows adding
> dataset to that group again as if it did not belong to 'mygroup'.

I'm not able to reproduce this behaviour using the latest development
version of CKAN (i.e. the current HEAD commit on the master branch at
github.com/okfn/ckan). Adding/removing datasets to/from groups with
APIv2 appears to work fine. What version of CKAN are you using?




More information about the ckan-dev mailing list