Commit 90ad01d1 authored by Rob Colbert's avatar Rob Colbert

gabctl accounts delete|suspend separated

`gabctl accounts suspend` does not remove user (can be undone).
`gabctl accounts delete` does remove user (cannot be undone).
parent 040f7c51
......@@ -170,7 +170,7 @@ module GabSocial
desc 'delete USERNAME', 'Delete a user'
long_desc <<-LONG_DESC
Remove a user account with a given USERNAME.
Suspend the account matching USERNAME and remove the associated user (can't be undone).
LONG_DESC
def delete(username)
account = Account.find_local(username)
......@@ -180,7 +180,7 @@ module GabSocial
exit(1)
end
say("Deleting user with #{account.statuses_count} statuses, this might take a while...")
say("Suspending account, removing #{account.statuses_count} statuses and user...")
SuspendAccountService.new.call(account, including_user: true)
say('OK', :green)
end
......@@ -439,6 +439,23 @@ module GabSocial
end
end
desc 'suspend USERNAME', 'Suspend a user'
long_desc <<-LONG_DESC
Suspend the user account with the given USERNAME (can be undone).
LONG_DESC
def suspend(username)
account = Account.find_local(username)
if account.nil?
say('No user with such username', :red)
exit(1)
end
say("Suspending user and removing #{account.statuses_count} statuses...")
SuspendAccountService.new.call(account, including_user: false)
say('OK', :green)
end
option :number, type: :numeric, aliases: [:n]
option :all, type: :boolean
desc 'approve [USERNAME]', 'Approve pending accounts'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment