Skip to content

Commit

Permalink
Republish documents after updating access limits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richardTowers committed Nov 21, 2024
1 parent d22c0e6 commit 72c7cc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/admin/edition_access_limited_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def update
render :edit
else
@edition.save!
PublishingApiDocumentRepublishingWorker.perform_async(@edition.document_id)

EditorialRemark.create!(
edition: @edition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 72c7cc3

Please sign in to comment.