Skip to content

Commit

Permalink
Merge pull request #9744 from alphagov/remove-orphaned-corpinfopage-d…
Browse files Browse the repository at this point in the history
…ashboard-filter

Remove dashboard filters for orphaned corporate info pages
  • Loading branch information
ryanb-gds authored Dec 17, 2024
2 parents b4a347f + a4770c4 commit e49d424
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/controllers/admin/dashboard_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
class Admin::DashboardController < Admin::BaseController
def index
if current_user.organisation
@draft_documents = Edition.authored_by(current_user).where(state: "draft").includes(:translations, :versions).in_reverse_chronological_order.reject do |edition|
edition.respond_to?(:organisation) && edition.organisation.nil?
end
@draft_documents = Edition.authored_by(current_user).where(state: "draft").includes(:translations, :versions).in_reverse_chronological_order

@force_published_documents = current_user.organisation.editions.force_published.includes(:translations, :versions).in_reverse_chronological_order.limit(5).reject do |edition|
edition.respond_to?(:organisation) && edition.organisation.nil?
end
@force_published_documents = current_user.organisation.editions.force_published.includes(:translations, :versions).in_reverse_chronological_order.limit(5)
end
end
end

0 comments on commit e49d424

Please sign in to comment.