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

Sean Hammond sean.hammond at okfn.org
Mon Apr 2 11:28:33 UTC 2012


> 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'.

Sorry it took so long to get back to you. That's interesting, I will
look into this and see if I can reproduce the problem using the latest
version of CKAN.




More information about the ckan-dev mailing list