Browse Source

DIV-826: display fact sheet D under appropriate conditions

pull/160/head
Benard Ebinu 7 years ago
parent
commit
18ab9b5afd
3 changed files with 7 additions and 5 deletions
  1. +1
    -1
      edivorce/apps/core/templates/question/06_children_facts.html
  2. +0
    -3
      edivorce/apps/core/templatetags/format_utils.py
  3. +6
    -1
      edivorce/apps/core/utils/derived.py

+ 1
- 1
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -416,7 +416,7 @@
</div>
{% if children_of_marriage == 'YES' and 'NO' not in children_financial_support %}
{% if children_of_marriage == 'YES' and 'NO' not in children_financial_support|load_json and number_children_over_19|integer > 0 %}
<div id="fact_sheet_d" class="question-well fact-sheets">
<h1>Child(ren) 19 Years or Older (Fact Sheet D)</h1>
<p>


+ 0
- 3
edivorce/apps/core/templatetags/format_utils.py View File

@ -165,9 +165,6 @@ def integer(value):
""" Return value as an int or nothing """
try:
print(value)
print(float(value))
print(int(float(value)))
return int(float(value))
except ValueError:
return ''

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

@ -172,8 +172,13 @@ def show_fact_sheet_d(responses, derived):
over 19, Fact Sheet D is indicated.
"""
try:
children_over_19 = float(responses.get('number_children_over_19', 0))
except ValueError:
children_over_19 = 0
support = json.loads(responses.get('children_financial_support', '[]'))
return (len(support) > 0 and
return (len(support) > 0 and children_over_19 > 0 and
'NO' not in support and has_children_of_marriage(responses, derived))


Loading…
Cancel
Save