Skip to content

Commit 14b71f3

Browse files
Apply suggestion from @thomasiles
Co-authored-by: Thomas Iles <tom.iles@digital.cabinet-office.gov.uk>
1 parent 450db42 commit 14b71f3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

app/controllers/forms/base_controller.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ def set_form
4949

5050
if @form.blank?
5151
I18n.with_locale(locale) do
52-
return render template: "forms/archived_welsh/show", locals: { form: live_english_version(form_id) }, status: :not_found if archived_welsh_version_with_live_english_form?(form_id)
52+
if locale == "cy"
53+
archived_welsh = Api::V2::FormDocumentRepository.find(form_id:, tag: :archived, language: :cy)
54+
live_english = Api::V2::FormDocumentRepository.find(form_id:, tag: :live, language: :en)
55+
56+
if archived_welsh.present? && live_english.present?
57+
return render template: "forms/archived_welsh/show",
58+
locals: { form: live_english },
59+
status: :not_found
60+
end
61+
end
62+
5363

5464
archived_form = Api::V2::FormDocumentRepository.find(form_id:, tag: :archived)
5565
return render template: "forms/archived/show", locals: { form_name: archived_form.name }, status: :not_found if archived_form.present?

0 commit comments

Comments
 (0)