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

Jaakko Louhio jaakko.louhio at floapps.com
Wed Mar 14 13:54:34 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'.

--
Jaakko




More information about the ckan-dev mailing list