From 762617e302c0dd72533a24ac8c129f6a1a925608 Mon Sep 17 00:00:00 2001 From: Toby Fey Date: Mon, 29 Jul 2024 22:34:15 -0400 Subject: [PATCH] changed logic --- .../data/questions/MOHUDEvictionProject.yml | 49 +++++++++++++------ .../data/questions/defense_logic.yml | 2 +- .../data/questions/file_a_motion.yml | 2 +- .../data/questions/shared.yml | 6 +-- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/docassemble/MOHUDEvictionProject/data/questions/MOHUDEvictionProject.yml b/docassemble/MOHUDEvictionProject/data/questions/MOHUDEvictionProject.yml index ab2f4b2..17b874f 100644 --- a/docassemble/MOHUDEvictionProject/data/questions/MOHUDEvictionProject.yml +++ b/docassemble/MOHUDEvictionProject/data/questions/MOHUDEvictionProject.yml @@ -100,8 +100,8 @@ code: | "beginning_to_user_information_duration": showifdef("beginning_to_user_information_duration.minutes"), "case_information_time": showifdef("snapshot_case_information_time"), "user_to_case_information_duration": showifdef("user_to_case_information_duration.minutes"), - "case_type": showif("case_type.true_values().elements",defined('case_type')), - "eviction_reason": showif("eviction_reason.true_values().elements",defined('eviction_reason')), + "case_type": case_type.true_values().elements, + "eviction_reason": eviction_reason.true_values().elements, "review_time": snapshot_review_time, "case_to_review_duration": showifdef("case_to_review_duration.minutes"), "discovery_time": snapshot_discovery_time, @@ -270,8 +270,8 @@ code: | "beginning_to_user_information_duration": beginning_to_user_information_duration.minutes, "case_information_time": showifdef("snapshot_case_information_time"), "user_to_case_information_duration": showifdef("user_to_case_information_duration.minutes"), - "case_type": showif("case_type.true_values().elements",defined('case_type')), - "eviction_reason": showif("eviction_reason.true_values().elements",defined('eviction_reason')), + "case_type": case_type.true_values().elements, + "eviction_reason": eviction_reason.true_values().elements, "review_time": snapshot_review_time, "case_to_review_duration": showifdef("case_to_review_duration.minutes"), "discovery_time": showifdef("snapshot_discovery_time"), @@ -296,8 +296,8 @@ code: | "beginning_to_user_information_duration": showifdef("beginning_to_user_information_duration.minutes"), "case_information_time": showifdef("snapshot_case_information_time"), "user_to_case_information_duration": showifdef("user_to_case_information_duration.minutes"), - "case_type": showif("case_type.true_values().elements",defined('case_type')), - "eviction_reason": showif("eviction_reason.true_values().elements",defined('eviction_reason')), + "case_type": case_type.true_values().elements, + "eviction_reason": eviction_reason.true_values().elements, "review_time": snapshot_review_time, "case_to_review_duration": showifdef("case_to_review_duration.minutes"), "discovery_time": snapshot_discovery_time, @@ -366,6 +366,8 @@ code: | if motion_to_set_aside_attachment.enabled: if motion_to_set_aside_judgment_order_exit: motion_to_set_aside_exit + elif judgment_date_more_than_one_year: + old_judgment_warning eviction_motion_to_continue_attachment.enabled eviction_motion_for_leave_attachment.enabled petition_date @@ -445,6 +447,29 @@ code: | other_parties[i].attorney[0].name.first other_parties[i].attorney.complete = True --- +sets: old_judgment_warning +id: soft exit old judgment +decoration: hand +question: | + % if person_answering == "tenant": + You may not want to {file} an {answer} + % else: + The tenant may not want to {file} an {answer} + % endif +subquestion: | + % if person_answering == "tenant": + You said that the final judgment date was $( judgment_date }, which was more than a year ago. Although you may still be able to set aside the judgment, you should talk to a lawyer because it is more complicated. + % else: + You said that the final judgment date was $( judgment_date }, which was more than a year ago. Although the tenant may still be able to set aside the judgment, the tenant should talk to a lawyer because it is more complicated. + % endif + +buttons: + - ${"I understand, let me keep going" if person_answering == "tenant" else "The tenant understands, let them keep going"}: + code: | + old_judgment_warning = True + - Exit: exit + url: https://motenanthelp.org/ +--- sets: posting_warning id: soft exit posting eviction decoration: hand @@ -692,14 +717,6 @@ continue button field: eviction_defender_intro buttons: - I agree: continue --- -only sets: case_type_kickout -id: case type kickout for answer -code: | - if not case_type["AC Rent and Possession"] and not case_type["AC Landlord Action (Bulk)"]: - if unlawful_detainer_kick_out_option: - motion_to_continue_order - case_type_kickout = True ---- code: | docket_number filing_date @@ -740,9 +757,9 @@ code: | --- depends on: - final_judgment - - judgment_date_more_than_30 + - judgment_date_more_than_one_year code: | - motion_to_set_aside_attachment.enabled = final_judgment and not judgment_date_more_than_30 + motion_to_set_aside_attachment.enabled = final_judgment and not judgment_date_more_than_one_year --- question: Motion to Set Aside subquestion: | diff --git a/docassemble/MOHUDEvictionProject/data/questions/defense_logic.yml b/docassemble/MOHUDEvictionProject/data/questions/defense_logic.yml index 7348ff8..5a00083 100644 --- a/docassemble/MOHUDEvictionProject/data/questions/defense_logic.yml +++ b/docassemble/MOHUDEvictionProject/data/questions/defense_logic.yml @@ -43,7 +43,7 @@ depends on: - defense_no_breach - defense_breach_not_material code: | - if case_type["AC Unlawful Detainer"]: + if eviction_reason["lease violation"]: defense_ud_did_not_violate_lease = ( defense_no_breach or defense_breach_not_material diff --git a/docassemble/MOHUDEvictionProject/data/questions/file_a_motion.yml b/docassemble/MOHUDEvictionProject/data/questions/file_a_motion.yml index eebf382..02973f7 100644 --- a/docassemble/MOHUDEvictionProject/data/questions/file_a_motion.yml +++ b/docassemble/MOHUDEvictionProject/data/questions/file_a_motion.yml @@ -50,7 +50,7 @@ code: | if motion_list['motion_to_set_aside_judgment']: final_judgment - if (motion_list['motion_to_dismiss'] and (not has_written_lease or lease_attached or not eviction_reason["nonpayment of rent"])) or (motion_list['motion_to_set_aside_judgment'] and (judgment_date_more_than_30 or not final_judgment)): + if (motion_list['motion_to_dismiss'] and (not has_written_lease or lease_attached or not eviction_reason["nonpayment of rent"])) or (motion_list['motion_to_set_aside_judgment'] and (judgment_date_more_than_one_year or not final_judgment)): warning_kickout_loop trial_court.name diff --git a/docassemble/MOHUDEvictionProject/data/questions/shared.yml b/docassemble/MOHUDEvictionProject/data/questions/shared.yml index c016bdc..63e6168 100644 --- a/docassemble/MOHUDEvictionProject/data/questions/shared.yml +++ b/docassemble/MOHUDEvictionProject/data/questions/shared.yml @@ -1028,12 +1028,12 @@ code: | depends on: judgment_date id: Calculating if judgment_date is more then 30 days ago code: | - thirty_days_ago = current_datetime() - date_interval(days=30) + one_year_ago = current_datetime() - date_interval(years=1) if final_judgment: - judgment_date_more_than_30 = judgment_date <= thirty_days_ago + judgment_date_more_than_one_year = judgment_date <= one_year_ago else: - judgment_date_more_than_30 = True + judgment_date_more_than_one_year = True --- id: supporting_statement question: |