diff --git a/edivorce/apps/core/static/js/functions.js b/edivorce/apps/core/static/js/functions.js index 462ff509..31f70cdc 100644 --- a/edivorce/apps/core/static/js/functions.js +++ b/edivorce/apps/core/static/js/functions.js @@ -289,7 +289,7 @@ var getValue = function(el, question){ $('#other_names_fields').find("input[type=text]").each(function () { // as per request, alias type will always be also known as for now // aliasType = $(this).val() === '' ? '' : $(this).siblings(".alias-type").val(); - value.push([aliasType, $(this).val()]); + value.push([aliasType, $(this).val().trim()]); }); return JSON.stringify(value); } diff --git a/edivorce/apps/core/utils/conditional_logic.py b/edivorce/apps/core/utils/conditional_logic.py index fb62f142..5ce0265e 100644 --- a/edivorce/apps/core/utils/conditional_logic.py +++ b/edivorce/apps/core/utils/conditional_logic.py @@ -130,7 +130,10 @@ def determine_missing_extraordinary_expenses(questions_dict): def get_cleaned_response_value(response): - ignore_values = [None, '', '[]', '[["",""]]', '[["also known as",""]]'] + if response is None: + return None + response = response.strip() + ignore_values = ['', '[]', '[["",""]]', '[["also known as",""]]'] if response not in ignore_values: return response return None diff --git a/edivorce/apps/core/utils/step_completeness.py b/edivorce/apps/core/utils/step_completeness.py index 921adbfb..7a8c27c0 100644 --- a/edivorce/apps/core/utils/step_completeness.py +++ b/edivorce/apps/core/utils/step_completeness.py @@ -100,7 +100,7 @@ def get_error_dict(questions_by_step, step, substep=None): substep_questions = children_substep_question_mapping[substep] step_questions = list(filter(lambda question_dict: question_dict['question_id'] in substep_questions, step_questions)) - show_section_errors = not step_started(step_questions) and not is_complete(step_questions) + show_section_errors = step_started(step_questions) and not is_complete(step_questions) if show_section_errors or children_substep_and_step_started: for question_dict in step_questions: if question_dict['error']: