diff --git a/app/models/form/subsection.rb b/app/models/form/subsection.rb index 07e7fe65c..0266fc448 100644 --- a/app/models/form/subsection.rb +++ b/app/models/form/subsection.rb @@ -24,9 +24,7 @@ class Form::Subsection end def status(log) - unless enabled?(log) - return :cannot_start_yet - end + return :cannot_start_yet unless enabled?(log) qs = applicable_questions(log) qs_optional_removed = qs.reject { |q| log.optional_fields.include?(q.id) } @@ -49,4 +47,8 @@ class Form::Subsection (q.displayed_to_user?(log) && !q.derived?) || q.has_inferred_check_answers_value?(log) end end + + def displayed_in_tasklist?(_log) + true + end end diff --git a/app/models/log.rb b/app/models/log.rb index c09cdd46a..e9dc9c69a 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -63,7 +63,7 @@ private end def all_fields_completed? - subsection_statuses = form.subsections.map { |subsection| subsection.status(self) }.uniq + subsection_statuses = form.subsections.map { |subsection| subsection.status(self) if subsection.displayed_in_tasklist?(self) }.uniq.compact subsection_statuses == [:completed] end diff --git a/app/views/logs/_tasklist.html.erb b/app/views/logs/_tasklist.html.erb index 6c82eb377..df8a3afad 100644 --- a/app/views/logs/_tasklist.html.erb +++ b/app/views/logs/_tasklist.html.erb @@ -9,7 +9,7 @@ <% end %>