From 8aaf3096171e2cbc8b8b073abd5a1edadc5e9958 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Thu, 30 Jun 2022 14:19:38 +0100 Subject: [PATCH] Refactor --- app/controllers/form_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 0d479ad41..aed35e7a1 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -10,8 +10,7 @@ class FormController < ApplicationController mandatory_questions_with_no_response = mandatory_questions_with_no_response(responses_for_page) if mandatory_questions_with_no_response.empty? && @case_log.update(responses_for_page) - session[:errors] = nil - session[:fields] = nil + session[:errors] = session[:fields] = nil redirect_to(successful_redirect_path) else redirect_path = "case_log_#{@page.id}_path"