Browse Source

feat: show qu header on BU error template if check_answer_label missing

pull/1524/head
Sam Seed 2 years ago
parent
commit
0578c86d47
  1. 6
      app/services/bulk_upload/lettings/year2023/row_parser.rb

6
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -548,13 +548,15 @@ private
if setup_question?(question)
fields.each do |field|
if errors[field].present?
errors.add(field, I18n.t("validations.not_answered", question: question.check_answer_label&.downcase), category: :setup)
question_text = question.check_answer_label.presence || question.header
errors.add(field, I18n.t("validations.not_answered", question: question_text&.downcase), category: :setup)
end
end
else
fields.each do |field|
unless errors.any? { |e| fields.include?(e.attribute) }
errors.add(field, I18n.t("validations.not_answered", question: question.check_answer_label&.downcase))
question_text = question.check_answer_label.presence || question.header
errors.add(field, I18n.t("validations.not_answered", question: question_text&.downcase))
end
end
end

Loading…
Cancel
Save