Skip to content

Commit

Permalink
Remove remove_invalid_worldorg_drafts rake task
Browse files Browse the repository at this point in the history
This was used to remove placeholder Worldwide Organisations.

We have remove the publishing of placeholder Worldwide Organisation
pages and resolved the issue that caused them to be published.

Therefore the rake task can be removed.
  • Loading branch information
brucebolt committed Aug 2, 2023
1 parent 44daeb5 commit 2af7fdc
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions lib/tasks/data_hygiene.rake
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,6 @@ namespace :data_hygiene do
end
end

desc "Removes invalid about page drafts from world organisations that can prevent editing"
task remove_invalid_worldorg_drafts: :environment do
about_pages = Edition
.where(document_type: "about", state: "draft")
.select { |edition| edition.base_path =~ /\A\/world\/organisations\/[^\/]+\z/ }
.map { |edition| [edition.document.content_id, edition.document.locale] }

puts "Found #{about_pages.size} invalid draft Worldwide Organisation editions to remove"
about_pages.each do |content_id, locale|
puts "Removing draft edition #{content_id}"
Commands::V2::DiscardDraft.call(
{
content_id:,
locale:,
},
)
end
end

desc "Bulk update the organisations associated with documents."
task :bulk_update_organisation, %i[csv_filename] => :environment do |_, args|
DataHygiene::BulkOrganisationUpdater.call(args[:csv_filename])
Expand Down

0 comments on commit 2af7fdc

Please sign in to comment.