Browse Source

Merge pull request #87 from bcgov/DIV-1097

DIV-1097 - Required textbox fields accept spaces as valid input
pull/163/head
Arianne 5 years ago
committed by GitHub
parent
commit
cf654b5e47
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions
  1. +1
    -1
      edivorce/apps/core/static/js/functions.js
  2. +4
    -1
      edivorce/apps/core/utils/conditional_logic.py
  3. +1
    -1
      edivorce/apps/core/utils/step_completeness.py

+ 1
- 1
edivorce/apps/core/static/js/functions.js View File

@ -289,7 +289,7 @@ var getValue = function(el, question){
$('#other_names_fields').find("input[type=text]").each(function () { $('#other_names_fields').find("input[type=text]").each(function () {
// as per request, alias type will always be also known as for now // as per request, alias type will always be also known as for now
// aliasType = $(this).val() === '' ? '' : $(this).siblings(".alias-type").val(); // aliasType = $(this).val() === '' ? '' : $(this).siblings(".alias-type").val();
value.push([aliasType, $(this).val()]);
value.push([aliasType, $(this).val().trim()]);
}); });
return JSON.stringify(value); return JSON.stringify(value);
} }


+ 4
- 1
edivorce/apps/core/utils/conditional_logic.py View File

@ -130,7 +130,10 @@ def determine_missing_extraordinary_expenses(questions_dict):
def get_cleaned_response_value(response): 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: if response not in ignore_values:
return response return response
return None return None

+ 1
- 1
edivorce/apps/core/utils/step_completeness.py View File

@ -100,7 +100,7 @@ def get_error_dict(questions_by_step, step, substep=None):
substep_questions = children_substep_question_mapping[substep] substep_questions = children_substep_question_mapping[substep]
step_questions = list(filter(lambda question_dict: question_dict['question_id'] in substep_questions, step_questions)) 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: if show_section_errors or children_substep_and_step_started:
for question_dict in step_questions: for question_dict in step_questions:
if question_dict['error']: if question_dict['error']:


Loading…
Cancel
Save