Skip to content

Commit b8bc74c

Browse files
Update filter of StatisticsAnnouncement
Only present to the user documents without an unpublished edition in the results page for filtering documents to connect to a StatisticsAnnouncement. This prevents a user connecting a draft edition which had unintended consequence of publishing the draft when the StatisticsAnnouncement was saved.
1 parent ea1ea55 commit b8bc74c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/controllers/admin/statistics_announcement_publications_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def params_filters
3535
end
3636

3737
def params_filters_with_default_state
38-
params_filters.reverse_merge("state" => "active")
38+
params_filters.reverse_merge("state" => "active", "without_draft" => true)
3939
end
4040

4141
def edition_filter_options

test/functional/admin/statistics_announcement_publications_controller_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Admin::StatisticsAnnouncementPublicationsControllerTest < ActionController
1010
state: "active",
1111
type: @official_statistics_announcement.publication_type.key,
1212
per_page: 15,
13+
without_draft: true,
1314
}
1415
end
1516

0 commit comments

Comments
 (0)