Browse Source

Trim whitespace so fields with only spaces are considered unfilled.

pull/160/head
ariannedee 5 years ago
parent
commit
9fc8474de2
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      edivorce/apps/core/static/js/functions.js
  2. +4
    -1
      edivorce/apps/core/utils/conditional_logic.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

Loading…
Cancel
Save