Mark requested deletion time nil on accounts CLI reattach (#40430)

This commit is contained in:
Matt Jankowski authored and Claire committed 2026-09-15 10:23:29 +02:00
1 parent 82edaee8fc
commit 99d26cad3d
2 files changed
+16 -1

No files matched your search

+2 -1
View File
@@ -100,7 +100,8 @@ module Mastodon::CLI
end
account.suspended_at = nil
user.account = account
account.requested_deletion_at = nil
user.account = account
if user.save
if options[:confirmed]
+14
View File
@@ -194,6 +194,20 @@ RSpec.describe Mastodon::CLI::Accounts do
it_behaves_like 'a new user with given email address and username'
end
context "when account's user is not present and account was previously deleted" do
let(:options) { { email: 'tootctl@example.com', reattach: true } }
before do
Fabricate(:account, username: 'tootctl_username', user: nil, requested_deletion_at: 10.days.ago)
end
it 'removes requested deletion timestamp' do
expect { subject }
.to output_results('OK')
.and change { Account.find_local('tootctl_username').requested_deletion_at }.to(nil)
end
end
end
end