From 72c7cc3a9ee80e660850456f1bd25a2f2b306e62 Mon Sep 17 00:00:00 2001 From: Richard Towers Date: Thu, 21 Nov 2024 13:08:59 +0000 Subject: [PATCH] Republish documents after updating access limits I was just burned by this not happening. I updated a bunch of editions to add number 10 to the access limited organisations, only to discover that number 10 still couldn't access them. On inspection, I worked out that the access limits had been updated in Whitehall, but not content store. Republishing the documents should ensure that they make it to the draft / live content stores any time their access limits are updated. --- app/controllers/admin/edition_access_limited_controller.rb | 1 + test/functional/admin/edition_access_limited_controller_test.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/controllers/admin/edition_access_limited_controller.rb b/app/controllers/admin/edition_access_limited_controller.rb index ec8baf9adeb..289ce34c6d9 100644 --- a/app/controllers/admin/edition_access_limited_controller.rb +++ b/app/controllers/admin/edition_access_limited_controller.rb @@ -16,6 +16,7 @@ def update render :edit else @edition.save! + PublishingApiDocumentRepublishingWorker.perform_async(@edition.document_id) EditorialRemark.create!( edition: @edition, diff --git a/test/functional/admin/edition_access_limited_controller_test.rb b/test/functional/admin/edition_access_limited_controller_test.rb index cf1350f06ca..17ec5d14769 100644 --- a/test/functional/admin/edition_access_limited_controller_test.rb +++ b/test/functional/admin/edition_access_limited_controller_test.rb @@ -64,6 +64,8 @@ class Admin::EditionAccessLimitedControllerTest < ActionController::TestCase supporting_organisations: [second_organisation], ) + PublishingApiDocumentRepublishingWorker.expects(:perform_async).with(edition.document_id) + editorial_remark = "Updating the organisations at the users request." put :update,