Project

General

Profile

Delete Multiple Users at one click

Added by Yogesh Dhandal over 10 years ago

Do we have any functionality where we can delete Multiple Users at one click


Replies (1)

RE: Delete Multiple Users at one click - Added by Martin Denizet (redmine.org team member) over 10 years ago

Hello Yogesh,

Short answer is: No, not possible at the moment.
However you can use the Rails console to do so, in the directory you installed Redmine:

./script/rails console production

PERFORM AND TEST A DATABASE BACKUP BEFORE GOING FURTHER!
Then in the console, if you know the ids of the users you want to delete, you can do something like (not tested):
user_ids_to_delete = [22,23,24,25]
users_to_delete = User.find( user_ids_to_delete )
users_to_delete.each do |user|
  user.destroy
end


BE CAREFUL BECAUSE THERE IS NO GOING BACK!
I suggest you test that on a test server for you to be confident with it before deleting object like that in production.
Please, also note that you could also just lock the accounts as it is possible to go back in case of error.
Cheers

    (1-1/1)