Deleting spam group

David Read edited this page Jan 7, 2015 · 1 revision
Clone this wiki locally

Here are some ways to purge a group called 'hacked-by-slayers-hack-team' (which is not a hack at all, simply spam/graffiti).

Using SQL

On your server run:

$ psql ckan -c "DELETE from WHERE name='hacked-by-slayers-hack-team'; DELETE from group_revision WHERE name='hacked-by-slayers-hack-team';"

Using API/curl

Or if you have CKAN 2.2 or later you can do this: (replace the host with your own CKAN server and put in your sysadmin's API key)

$ curl -H 'Authorization:yourAPIkeyhere'

Using Paster shell

Alternatively you'll need to use paster shell:

$ paster --plugin=pylons shell /var/ckan/ckan.ini

g = model.Group.get('hacked-by-slayers-hack-team') assert g (check there is not an error) g.delete() model.repo.new_revision() model.repo.commit_and_remove() model.Group.get('hacked-by-slayers-hack-team') assert not model.Group.get('hacked-by-slayers-hack-team') (check there is not an error)