Ask Your Question

SQL command to delete all users with karma 1

asked 2016-03-05 12:47:09 -0500

kristof's avatar

updated 2016-06-15 06:19:08 -0500

Evgeny's avatar

I have more than 2000 user accounts which need to be deleted. In the /admin/ page I cannot filter these users out.

Is there perhaps an SQL command that allows me to delete all the users with karma 1 (or users without any posts).

To be sure -- because I am not very technical -- what is an SQL to backup the database first. And what would be to a SQL command that lists all the users satisfying my criteria. Just want to be sure that I don't delete all users.

Thanks :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-09 05:54:15 -0500

Evgeny's avatar

You might log in to the django shell:

python shell

Then type :

from askbot.models import User
uu = User.objects.filter(askbot_profile__reputation=1) #or (reputation=1) for versions < 0.8
for u in uu:
edit flag offensive delete link more


can it be done with UI?

Andy's avatar Andy  ( 2016-03-09 21:44:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-03-05 12:41:58 -0500

Seen: 427 times

Last updated: Mar 09 '16