Skip to content

Commit 91b2597

Browse files
Merge pull request #5818 from nhsuk/alistair/national-reporting-edit-location-performance-fix
Filter schools when editing location on NR records
2 parents 4755dae + 54079be commit 91b2597

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/controllers/draft_vaccination_records_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def set_batches
244244
def set_locations
245245
@locations =
246246
if @draft_vaccination_record.bulk_upload_user_and_record?
247-
Location.school.order(:name)
247+
Location.school.where(status: "open").order(:name)
248248
else
249249
policy_scope(Location).community_clinic
250250
end

app/views/draft_vaccination_records/location.html.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
caption: { text: @patient.full_name },
1515
data: { module: "app-autocomplete" } do %>
1616

17-
<% @locations.find_each do |school| %>
18-
<%= tag.option location_display_name(school, show_urn: true),
19-
value: school.id,
20-
selected: school.id == @draft_vaccination_record.location&.id,
21-
data: { hint: format_address_single_line(school) } %>
17+
<% @locations.find_each do |location| %>
18+
<%= tag.option location_display_name(location, show_urn: true),
19+
value: location.id,
20+
selected: location.id == @draft_vaccination_record.location&.id,
21+
data: { hint: format_address_single_line(location) } %>
2222
<% end %>
2323
<%= tag.option "Unknown", value: "unknown", selected: @draft_vaccination_record.location.nil? %>
2424
<% end %>

spec/features/edit_vaccination_record_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def given_a_bulk_upload_team_exists
456456
year_group: 8
457457
)
458458

459-
@school = create(:school, name: "A New School")
459+
@school = create(:school, name: "A New School", status: "open")
460460

461461
@vaccine = @programme.vaccines.first
462462

0 commit comments

Comments
 (0)