From 66a70ebb6e64c97dd9e0b2ffaeaa33aad3a28beb Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 6 Dec 2022 23:38:03 +0100 Subject: Fix pre-4.0 admin action logs (#22091) * Fix BackfillAdminActionLogs post-deployment migration * Improve migration tests * Backfill admin action logs again --- lib/tasks/tests.rake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake index 96d2f7112..1dd25abb9 100644 --- a/lib/tasks/tests.rake +++ b/lib/tasks/tests.rake @@ -43,6 +43,16 @@ namespace :tests do puts 'CustomFilterKeyword records not created as expected' exit(1) end + + unless Admin::ActionLog.find_by(target_type: 'DomainBlock', target_id: 1).human_identifier == 'example.org' + puts 'Admin::ActionLog domain block records not updated as expected' + exit(1) + end + + unless Admin::ActionLog.find_by(target_type: 'EmailDomainBlock', target_id: 1).human_identifier == 'example.org' + puts 'Admin::ActionLog email domain block records not updated as expected' + exit(1) + end end desc 'Populate the database with test data for 2.4.3' @@ -84,8 +94,8 @@ namespace :tests do VALUES (1, 'destroy', 'Account', 1, now(), now()), (1, 'destroy', 'User', 1, now(), now()), - (1, 'destroy', 'DomainBlock', 1312, now(), now()), - (1, 'destroy', 'EmailDomainBlock', 1312, now(), now()), + (1, 'destroy', 'DomainBlock', 1, now(), now()), + (1, 'destroy', 'EmailDomainBlock', 1, now(), now()), (1, 'destroy', 'Status', 1, now(), now()), (1, 'destroy', 'CustomEmoji', 3, now(), now()); SQL -- cgit From c52263f6f89f35414e59f95c877141a80e9bb79d Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 7 Dec 2022 14:13:10 +0100 Subject: Fix deprecation warning in `tootctl accounts rotate` (#22120) --- lib/mastodon/accounts_cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/mastodon/accounts_cli.rb b/lib/mastodon/accounts_cli.rb index c8a8448ed..77cbef84e 100644 --- a/lib/mastodon/accounts_cli.rb +++ b/lib/mastodon/accounts_cli.rb @@ -541,7 +541,7 @@ module Mastodon old_key = account.private_key new_key = OpenSSL::PKey::RSA.new(2048) account.update(private_key: new_key.to_pem, public_key: new_key.public_key.to_pem) - ActivityPub::UpdateDistributionWorker.perform_in(delay, account.id, sign_with: old_key) + ActivityPub::UpdateDistributionWorker.perform_in(delay, account.id, { 'sign_with' => old_key }) end end end -- cgit