Skip to content

Commit

Permalink
Merge pull request #131 from alphagov/withdrawn
Browse files Browse the repository at this point in the history
Do not sync withdrawn documents
  • Loading branch information
csutter authored Nov 30, 2023
2 parents bb2ac75 + d913ffa commit 994fed7
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 430 deletions.
8 changes: 7 additions & 1 deletion app/models/concerns/publishing_api/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def unpublish?
end

def ignore?
on_ignorelist? || ignored_locale? || unaddressable?
on_ignorelist? || ignored_locale? || unaddressable? || withdrawn?
end

def ignore_reason
Expand All @@ -28,6 +28,8 @@ def ignore_reason
"locale not permitted (#{locale})"
elsif unaddressable?
"unaddressable"
elsif withdrawn?
"withdrawn"
end
end

Expand Down Expand Up @@ -55,6 +57,10 @@ def unaddressable?
base_path.blank? && external_link.blank?
end

def withdrawn?
document_hash[:withdrawn_notice].present?
end

def document_type
document_hash.fetch(:document_type)
end
Expand Down
Loading

0 comments on commit 994fed7

Please sign in to comment.