From 345d6fd1589ae987525a6a1ce1cec0d11a41b5cb Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 12:39:26 -0700 Subject: [PATCH 1/8] Call after_file_documents when EFILING_HUB_ENABLED is False --- edivorce/apps/core/utils/cso_filing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/edivorce/apps/core/utils/cso_filing.py b/edivorce/apps/core/utils/cso_filing.py index d9bf954c..7d15d7ca 100644 --- a/edivorce/apps/core/utils/cso_filing.py +++ b/edivorce/apps/core/utils/cso_filing.py @@ -43,6 +43,9 @@ def file_documents(request, responses, initial=False): if msg: return msg, None + else: + return after_file_documents(request, initial) + return None, None From 528b2bb5a680d457f08b3edfdf7cb04ad5d08ad5 Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 12:47:46 -0700 Subject: [PATCH 2/8] Updated error handling to reduce nesting --- edivorce/apps/core/utils/cso_filing.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/edivorce/apps/core/utils/cso_filing.py b/edivorce/apps/core/utils/cso_filing.py index 7d15d7ca..e5c95f90 100644 --- a/edivorce/apps/core/utils/cso_filing.py +++ b/edivorce/apps/core/utils/cso_filing.py @@ -28,23 +28,22 @@ def file_documents(request, responses, initial=False): if errors: return errors, None - if settings.EFILING_HUB_ENABLED: - hub = EFilingHub(initial_filing=initial) - - post_files, documents = hub.get_files(request, responses, uploaded, generated) - location = hub.get_location(responses) - parties = hub.get_parties(responses) + if not settings.EFILING_HUB_ENABLED: + return after_file_documents(request, initial) - redirect_url, msg = hub.upload(request, post_files, documents, parties, location) + hub = EFilingHub(initial_filing=initial) + post_files, documents = hub.get_files(request, responses, uploaded, generated) + location = hub.get_location(responses) + parties = hub.get_parties(responses) - if redirect_url: - return errors, redirect_url + redirect_url, msg = hub.upload(request, post_files, documents, parties, location) - if msg: - return msg, None + if msg: + errors.append(msg) + return errors, None - else: - return after_file_documents(request, initial) + if redirect_url: + return None, redirect_url return None, None From d97c75de290d5adecb15487f1e99fd4f5d4914fb Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 13:08:57 -0700 Subject: [PATCH 3/8] Escape HTML Double Quote Entities (link checker issue) --- edivorce/apps/core/management/commands/link_check.py | 3 +++ edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html | 2 +- edivorce/apps/core/templates/prequalification/step_02.html | 4 ++-- edivorce/apps/core/templates/prequalification/step_03.html | 4 ++-- edivorce/apps/core/templates/prequalification/step_04.html | 2 +- edivorce/apps/core/templates/question/05_separation.html | 4 ++-- .../core/templates/question/06_children_income_expenses.html | 2 +- .../apps/core/templates/question/06_children_what_for.html | 4 ++-- edivorce/apps/core/templates/question/08_property.html | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/edivorce/apps/core/management/commands/link_check.py b/edivorce/apps/core/management/commands/link_check.py index 86e718ee..8cc4cf5c 100644 --- a/edivorce/apps/core/management/commands/link_check.py +++ b/edivorce/apps/core/management/commands/link_check.py @@ -29,6 +29,9 @@ class Command(BaseCommand): file_path = os.path.join(root, file) fs = open(file_path) + + print('Parsing: ' + fs.name) + soup = BeautifulSoup(fs, 'html.parser') links = soup.find_all('a', href=True) for link in links: diff --git a/edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html b/edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html index 6a78f3ce..e67baec2 100644 --- a/edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html +++ b/edivorce/apps/core/templates/pdf/partials/fact_sheet_d.html @@ -12,7 +12,7 @@ {{ responses.number_children_over_19_need_support }}
  • - Child support is to be paid by {{ derived.child_support_payor }} (the “payor”) + Child support is to be paid by {{ derived.child_support_payor }} (the “payor”)
  • Monthly Guidelines table amount of the payor under Schedule 1 of the Guidelines: diff --git a/edivorce/apps/core/templates/prequalification/step_02.html b/edivorce/apps/core/templates/prequalification/step_02.html index 4d6bb046..37de2f95 100644 --- a/edivorce/apps/core/templates/prequalification/step_02.html +++ b/edivorce/apps/core/templates/prequalification/step_02.html @@ -147,9 +147,9 @@ {% block sidebarText %}

    Ordinarily Resident

    - The legal definition of “ordinarily resident” is: the place where in the + The legal definition of “ordinarily resident” is: the place where in the settled routine of an individual's life, he or she regularly, normally or - customarily lives. “Ordinarily” is the word is used in s. 3(1) of the + customarily lives. “Ordinarily” is the word is used in s. 3(1) of the Divorce Act…. A court in a province has jurisdiction to hear and determine a divorce proceeding if either spouse has been ordinarily resident in the province for at least one year immediately preceding the diff --git a/edivorce/apps/core/templates/prequalification/step_03.html b/edivorce/apps/core/templates/prequalification/step_03.html index 81503496..85c40396 100644 --- a/edivorce/apps/core/templates/prequalification/step_03.html +++ b/edivorce/apps/core/templates/prequalification/step_03.html @@ -193,9 +193,9 @@ of 90 days or less. If they live together for more than 90 days, the one-year period of separation starts all over again from the date of the last separation. For more information on separation, - refer to “Separation and Separation Agreements” from the + target="_blank">Separation and Separation Agreements” from the Canadian Bar Association.

    diff --git a/edivorce/apps/core/templates/prequalification/step_04.html b/edivorce/apps/core/templates/prequalification/step_04.html index 0eb22c3f..27ebb1bb 100644 --- a/edivorce/apps/core/templates/prequalification/step_04.html +++ b/edivorce/apps/core/templates/prequalification/step_04.html @@ -287,7 +287,7 @@

    Louis and Jocelyn are divorcing. They have established that the Federal Guidelines apply to their situation. They now need to determine which of their children are - “children of the marriage” —that is, which ones are dependent and need their financial support. + “children of the marriage” —that is, which ones are dependent and need their financial support.

    Tom and Sam are both under the age of majority and are still dependent. Louis and Jocelyn diff --git a/edivorce/apps/core/templates/question/05_separation.html b/edivorce/apps/core/templates/question/05_separation.html index bb9739fe..05d8720c 100644 --- a/edivorce/apps/core/templates/question/05_separation.html +++ b/edivorce/apps/core/templates/question/05_separation.html @@ -33,11 +33,11 @@

    We are legally required to ask whether or not you and {% spouse_name %} - have agreed to deceive the court. This is called “collusion - ”. An example of collusion is when a couple agrees to lie about the date of separation to speed up the divorce process. + ”. An example of collusion is when a couple agrees to lie about the date of separation to speed up the divorce process. {% if no_collusion_error %}{% include 'partials/required.html' with inline=True %}{% endif %}

    {% if no_collusion_error %} diff --git a/edivorce/apps/core/templates/question/06_children_income_expenses.html b/edivorce/apps/core/templates/question/06_children_income_expenses.html index bdd80b4e..67b26ede 100644 --- a/edivorce/apps/core/templates/question/06_children_income_expenses.html +++ b/edivorce/apps/core/templates/question/06_children_income_expenses.html @@ -219,7 +219,7 @@

    Schedule 1 refers to the federal child support tables which set out the amount of monthly child support payments for each province on the basis of the annual income of the spouse ordered to pay - child support (the “support payer”) and the number of children for whom a table amount is payable. + child support (the “support payer”) and the number of children for whom a table amount is payable.

    diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index f0faaee9..efd3abd4 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -476,9 +476,9 @@ {% block formNext %}{% next_step step='children' sub_step='what_for' %}{% endblock %} {% block sidebarText %} -

    What does the law mean by “best interests of the child”?

    +

    What does the law mean by “best interests of the child”?

    - The “best interests of the child” is a legal test used to decide what would best + The “best interests of the child” is a legal test used to decide what would best protect your child’s physical, psychological, and emotional safety, security and well-being. To determine what is in the child’s best interests when making parenting arrangements, you must consider factors including: diff --git a/edivorce/apps/core/templates/question/08_property.html b/edivorce/apps/core/templates/question/08_property.html index 38d09daa..7b927a17 100644 --- a/edivorce/apps/core/templates/question/08_property.html +++ b/edivorce/apps/core/templates/question/08_property.html @@ -88,7 +88,7 @@

    A court will divide family property or debt unequally only if it - would be “significantly unfair” to divide it equally. This means + would be “significantly unfair” to divide it equally. This means that a court will not order an unequal division in most cases. The court can look at a number of factors when deciding whether to divide property or debt unequally.

    From 7f7e10827fb46176019d43c40b5094896d437351 Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 13:34:55 -0700 Subject: [PATCH 4/8] Get return URLs for efilng using custom code, not request.build_absolute_uri --- edivorce/apps/core/efilinghub.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/edivorce/apps/core/efilinghub.py b/edivorce/apps/core/efilinghub.py index ffd9dc20..c9e0292d 100644 --- a/edivorce/apps/core/efilinghub.py +++ b/edivorce/apps/core/efilinghub.py @@ -230,17 +230,17 @@ class EFilingHub: if parties: package['filingPackage']['parties'] = parties # update return urls - package['navigationUrls']['error'] = request.build_absolute_uri( + package['navigationUrls']['error'] = self._get_absolute_url( reverse('dashboard_nav', args=['check_with_registry'])) if self.initial_filing: - package['navigationUrls']['cancel'] = request.build_absolute_uri( + package['navigationUrls']['cancel'] = self._get_absolute_url( reverse('dashboard_nav', args=['initial_filing'])) - package['navigationUrls']['success'] = request.build_absolute_uri( + package['navigationUrls']['success'] = self._get_absolute_url( reverse('after_submit_initial_files')) else: - package['navigationUrls']['cancel'] = request.build_absolute_uri( + package['navigationUrls']['cancel'] = self._get_absolute_url( reverse('dashboard_nav', args=['final_filing'])) - package['navigationUrls']['success'] = request.build_absolute_uri( + package['navigationUrls']['success'] = self._get_absolute_url( reverse('after_submit_final_files')) return package @@ -364,6 +364,9 @@ class EFilingHub: return d + def _get_absolute_url(self, path): + return settings.PROXY_BASE_URL + path + # -- EFILING HUB INTERFACE -- def get_files(self, request, responses, uploaded, generated): From bfc6d055f89ccec44a215dd31b098110af89a5de Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 13:57:14 -0700 Subject: [PATCH 5/8] Fixed broken efiling --- edivorce/apps/core/efilinghub.py | 17 ++++++++++------- edivorce/apps/core/utils/cso_filing.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/edivorce/apps/core/efilinghub.py b/edivorce/apps/core/efilinghub.py index c9e0292d..0b155b10 100644 --- a/edivorce/apps/core/efilinghub.py +++ b/edivorce/apps/core/efilinghub.py @@ -231,17 +231,17 @@ class EFilingHub: package['filingPackage']['parties'] = parties # update return urls package['navigationUrls']['error'] = self._get_absolute_url( - reverse('dashboard_nav', args=['check_with_registry'])) + request, reverse('dashboard_nav', args=['check_with_registry'])) if self.initial_filing: package['navigationUrls']['cancel'] = self._get_absolute_url( - reverse('dashboard_nav', args=['initial_filing'])) + request, reverse('dashboard_nav', args=['initial_filing'])) package['navigationUrls']['success'] = self._get_absolute_url( - reverse('after_submit_initial_files')) + request, reverse('after_submit_initial_files')) else: package['navigationUrls']['cancel'] = self._get_absolute_url( - reverse('dashboard_nav', args=['final_filing'])) + request, reverse('dashboard_nav', args=['final_filing'])) package['navigationUrls']['success'] = self._get_absolute_url( - reverse('after_submit_final_files')) + request, reverse('after_submit_final_files')) return package @@ -364,8 +364,11 @@ class EFilingHub: return d - def _get_absolute_url(self, path): - return settings.PROXY_BASE_URL + path + def _get_absolute_url(self, request, path): + if settings.PROXY_BASE_URL: + return settings.PROXY_BASE_URL + path + else: + return request.get_host() + path # -- EFILING HUB INTERFACE -- def get_files(self, request, responses, uploaded, generated): diff --git a/edivorce/apps/core/utils/cso_filing.py b/edivorce/apps/core/utils/cso_filing.py index e5c95f90..ff97b6c4 100644 --- a/edivorce/apps/core/utils/cso_filing.py +++ b/edivorce/apps/core/utils/cso_filing.py @@ -38,7 +38,7 @@ def file_documents(request, responses, initial=False): redirect_url, msg = hub.upload(request, post_files, documents, parties, location) - if msg: + if msg != 'success': errors.append(msg) return errors, None From fa11fc5e08fbac1299f818b2b0097373f8d5adf5 Mon Sep 17 00:00:00 2001 From: Gerrit van der Merwe Date: Mon, 26 Oct 2020 14:10:10 -0700 Subject: [PATCH 6/8] DIV-1211 - Updated broken links --- edivorce/apps/core/templates/legal.html | 2 +- edivorce/apps/core/templates/prequalification/step_05.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/edivorce/apps/core/templates/legal.html b/edivorce/apps/core/templates/legal.html index 4abe97dd..fe03c4d1 100644 --- a/edivorce/apps/core/templates/legal.html +++ b/edivorce/apps/core/templates/legal.html @@ -23,7 +23,7 @@

    Online resources

    - You may want to look at the Divorce self-help kit + You may want to look at the Divorce self-help guide on the Family Law in British Columbia website for a step-by-step guide. You can also visit ClickLaw and the Justice Education Society for online legal information. diff --git a/edivorce/apps/core/templates/prequalification/step_05.html b/edivorce/apps/core/templates/prequalification/step_05.html index 1178ca27..568d94ed 100644 --- a/edivorce/apps/core/templates/prequalification/step_05.html +++ b/edivorce/apps/core/templates/prequalification/step_05.html @@ -31,7 +31,7 @@ title="Original Marriage Certificate

    The marriage certificate you received at the church — or any other place where you were married — isn't acceptable in court. You can get a marriage certificate or a certified copy of the registration of marriage from - Vital Statistics + Vital Statistics (an office run by the provincial government)." >marriage certificate or

    -

    If you were married in B.C.
    If you were married in B.C. you can get your marriage certificate or a certified copy of the registration of marriage from Vital Statistics (an office run by the provincial government).

    +

    If you were married in B.C.
    If you were married in B.C. you can get your marriage certificate or a certified copy of the registration of marriage from Vital Statistics (an office run by the provincial government).

    If You Were Married in Another Province
    If you were married in another province you need to get the official marriage certificate or registration of marriage from the office equivalent to the Department of Vital Statistics in that province.

    From 8090a125429d6b65be821664e629506c0a4c44af Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 14:23:09 -0700 Subject: [PATCH 7/8] Enable efiling hub on OpenShift --- edivorce/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edivorce/settings/base.py b/edivorce/settings/base.py index 7f3e3309..e82b0508 100644 --- a/edivorce/settings/base.py +++ b/edivorce/settings/base.py @@ -185,7 +185,7 @@ DEBUG_TOOLBAR_CONFIG = { SECURE_BROWSER_XSS_FILTER = True # eFiling Hub settings -EFILING_HUB_ENABLED = False +EFILING_HUB_ENABLED = True EFILING_HUB_TOKEN_BASE_URL = env('EFILING_HUB_TOKEN_BASE_URL', 'https://efiling.gov.bc.ca') EFILING_HUB_REALM = env('EFILING_HUB_REALM', 'abc') EFILING_HUB_CLIENT_ID = env('EFILING_HUB_CLIENT_ID', 'abc') From d91c4b7f4b8c8efdba583bdcd7447fd9efc288eb Mon Sep 17 00:00:00 2001 From: Michael Olund Date: Mon, 26 Oct 2020 15:40:58 -0700 Subject: [PATCH 8/8] Missing request scheme from local urls --- edivorce/apps/core/efilinghub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edivorce/apps/core/efilinghub.py b/edivorce/apps/core/efilinghub.py index 0b155b10..a535d40a 100644 --- a/edivorce/apps/core/efilinghub.py +++ b/edivorce/apps/core/efilinghub.py @@ -368,7 +368,7 @@ class EFilingHub: if settings.PROXY_BASE_URL: return settings.PROXY_BASE_URL + path else: - return request.get_host() + path + return request.build_absolute_uri(path) # -- EFILING HUB INTERFACE -- def get_files(self, request, responses, uploaded, generated):