diff --git a/edivorce/apps/core/templates/question/06_children_facts.html b/edivorce/apps/core/templates/question/06_children_facts.html index a3d6c580..c90ddf50 100644 --- a/edivorce/apps/core/templates/question/06_children_facts.html +++ b/edivorce/apps/core/templates/question/06_children_facts.html @@ -416,7 +416,7 @@ -{% 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 %}
diff --git a/edivorce/apps/core/templatetags/format_utils.py b/edivorce/apps/core/templatetags/format_utils.py index f74de2a9..d5425718 100644 --- a/edivorce/apps/core/templatetags/format_utils.py +++ b/edivorce/apps/core/templatetags/format_utils.py @@ -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 '' diff --git a/edivorce/apps/core/utils/derived.py b/edivorce/apps/core/utils/derived.py index 94efc233..4e2dac71 100644 --- a/edivorce/apps/core/utils/derived.py +++ b/edivorce/apps/core/utils/derived.py @@ -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))