Delete my account with the console

Hi!

I have a weird issue with a Discourse forum, and I didn’t fine a solution by myself: I installed a forum, I have access to the console but I don’t run it. I asked to the current admin to delete my account because I don’t want to be involve in this mess, but he refuses.

Usually I would be fine letting my account in a forum without using it, but the admin like to Impersonate every account (like mine, or discobot) to post weird stuff, and I really don’t like it. I tried to talk some sense with this person but I don’t trust him at all.

I would prefer to delete my account permanently. I didn’t find a way via Discourse with an admin account, or even a developper’s account (with the function Impersonate) to do it properly.

Is there a way to do it with the console, without messing up the database?

I know the basic stuff (./launcher enter app then rails c) but not the exact command to do.

Thanks, it would relieve me a lot!

1 Like

@neil mentioned this command in a message earlier today. I’d wait for him to confirm this does what you’d like, and you’ll likely need to modify the command:

UserDestroyer.new(neil).destroy(user, delete_posts: true)
7 Likes

Yes that command will do it. If you want the system user to do it:

UserDestroyer.new(Discourse.system_user).destroy(User.find_by_username('...'), delete_posts: true)
6 Likes

I thought an admin could not impersonate another admin user?

1 Like

Thanks neil I’ll try tonight :+1:

@michaeld : I wasn’t a developper account at the time, he could’ve demoted me during his jokes

1 Like

Admins can’t demote other admins.
And you also say

which is impossible as well… weird story.

I just checked and a admin with developer access can impersonate anyone, including admin accounts

edit: worked perfectly, thanks @neil and @jomaxro - this is a relieve

6 Likes

This topic was automatically closed after 2284 days. New replies are no longer allowed.