From df76b911724b13b38d6fdd6fb8dc22635121dc7e Mon Sep 17 00:00:00 2001 From: ariannedee Date: Mon, 26 Oct 2020 15:50:03 -0700 Subject: [PATCH 1/2] Handle filing_submitted=="False" --- edivorce/apps/core/templates/dashboard/final_filing.html | 6 +++--- edivorce/apps/core/templates/dashboard/initial_filing.html | 6 +++--- edivorce/apps/core/templates/dashboard/next_steps.html | 4 ++-- edivorce/apps/core/templates/dashboard/wait_for_number.html | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/edivorce/apps/core/templates/dashboard/final_filing.html b/edivorce/apps/core/templates/dashboard/final_filing.html index f897228b..cb99f267 100644 --- a/edivorce/apps/core/templates/dashboard/final_filing.html +++ b/edivorce/apps/core/templates/dashboard/final_filing.html @@ -10,7 +10,7 @@ {% block content %}

Final Filing

- {% if final_filing_submitted %} + {% if final_filing_submitted == 'True' %}

You have already completed this step. @@ -262,7 +262,7 @@ hello {% endif %} {% endif %} - {% if not final_filing_submitted and how_to_file == 'Online' %} + {% if final_filing_submitted != 'True' and how_to_file == 'Online' %}

Filing with Court Services Online

When you click Submit Documents, you will be taken to the Court Services Online e-filing hub. In the next few steps you will be able to do a final review of your filed documentation, @@ -279,7 +279,7 @@ {% block formbuttons %}

   Back - {% if how_to_file == 'Online' and not final_filing_submitted %} + {% if how_to_file == 'Online' and final_filing_submitted != 'True'%}     Submit Documents diff --git a/edivorce/apps/core/templates/dashboard/initial_filing.html b/edivorce/apps/core/templates/dashboard/initial_filing.html index b17a8324..f8a275f9 100644 --- a/edivorce/apps/core/templates/dashboard/initial_filing.html +++ b/edivorce/apps/core/templates/dashboard/initial_filing.html @@ -9,7 +9,7 @@ {% block content %}

Initial Filing

- {% if initial_filing_submitted %} + {% if initial_filing_submitted == 'True' %}

You have already completed this step.

@@ -94,7 +94,7 @@

Filing with Court Services Online

- When you click Next, you will be taken to the Court Services Online e-filing hub. + When you click Submit Documents, you will be taken to the Court Services Online e-filing hub. In the next few steps you will be able to do a final review of the documents you are submitting for filing, pay for your filing and (if completed successfully) receive a Package Number.

@@ -125,7 +125,7 @@ {% block formbuttons %}
   Back - {% if initial_filing_submitted %} + {% if initial_filing_submitted == 'True' %} Next    {% elif how_to_file == 'Online' %} diff --git a/edivorce/apps/core/templates/dashboard/next_steps.html b/edivorce/apps/core/templates/dashboard/next_steps.html index 7e8cdc4c..46253f2d 100644 --- a/edivorce/apps/core/templates/dashboard/next_steps.html +++ b/edivorce/apps/core/templates/dashboard/next_steps.html @@ -9,7 +9,7 @@ {% block content %}

Filing Completed

{% if how_to_file == 'Online' %} - {% if final_filing_submitted %} + {% if final_filing_submitted == 'True' %}

You have successfully completed filing online.

@@ -31,7 +31,7 @@ This e-mail will include a {% include "partials/tooltips/court_file_number.html" %}, please keep this number for your records and use it if filing any additional documents.

- {% if final_filing_submitted %} + {% if final_filing_submitted == 'True' %}

Filing Status

diff --git a/edivorce/apps/core/templates/dashboard/wait_for_number.html b/edivorce/apps/core/templates/dashboard/wait_for_number.html index 24d3b445..ce074b2c 100644 --- a/edivorce/apps/core/templates/dashboard/wait_for_number.html +++ b/edivorce/apps/core/templates/dashboard/wait_for_number.html @@ -7,7 +7,7 @@ {% block container_col %}dashboard-content{% endblock %} {% block content %}

Wait for Court File Number

- {% if initial_filing_submitted %} + {% if initial_filing_submitted == 'True' %}

You’ve successfully completed your initial filing with the Court Registry.

From 864cb92281f4630c31b617a1edeb5914dc228c7e Mon Sep 17 00:00:00 2001 From: ariannedee Date: Mon, 26 Oct 2020 15:50:28 -0700 Subject: [PATCH 2/2] Remove eFiling hub flag and set some callback URLs --- edivorce/apps/core/efilinghub.py | 10 ++++++---- edivorce/apps/core/utils/cso_filing.py | 22 ++++++++++------------ edivorce/apps/core/views/efiling.py | 2 ++ edivorce/apps/core/views/main.py | 2 ++ edivorce/settings/base.py | 1 - edivorce/settings/local.py | 2 -- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/edivorce/apps/core/efilinghub.py b/edivorce/apps/core/efilinghub.py index ffd9dc20..57e5dce3 100644 --- a/edivorce/apps/core/efilinghub.py +++ b/edivorce/apps/core/efilinghub.py @@ -230,16 +230,18 @@ class EFilingHub: if parties: package['filingPackage']['parties'] = parties # update return urls - package['navigationUrls']['error'] = request.build_absolute_uri( - reverse('dashboard_nav', args=['check_with_registry'])) if self.initial_filing: - package['navigationUrls']['cancel'] = request.build_absolute_uri( + package['navigationUrls']['error'] = request.build_absolute_uri( reverse('dashboard_nav', args=['initial_filing'])) + package['navigationUrls']['cancel'] = request.build_absolute_uri( + reverse('dashboard_nav', args=['initial_filing'])) + '?cancelled=1' package['navigationUrls']['success'] = request.build_absolute_uri( reverse('after_submit_initial_files')) else: - package['navigationUrls']['cancel'] = request.build_absolute_uri( + package['navigationUrls']['error'] = request.build_absolute_uri( reverse('dashboard_nav', args=['final_filing'])) + package['navigationUrls']['cancel'] = request.build_absolute_uri( + reverse('dashboard_nav', args=['final_filing'])) + '?cancelled=1' package['navigationUrls']['success'] = request.build_absolute_uri( reverse('after_submit_final_files')) diff --git a/edivorce/apps/core/utils/cso_filing.py b/edivorce/apps/core/utils/cso_filing.py index d9bf954c..d540821a 100644 --- a/edivorce/apps/core/utils/cso_filing.py +++ b/edivorce/apps/core/utils/cso_filing.py @@ -28,21 +28,19 @@ def file_documents(request, responses, initial=False): if errors: return errors, None - if settings.EFILING_HUB_ENABLED: - hub = EFilingHub(initial_filing=initial) + 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) + post_files, documents = hub.get_files(request, responses, uploaded, generated) + location = hub.get_location(responses) + parties = hub.get_parties(responses) - redirect_url, msg = hub.upload(request, post_files, documents, parties, location) + redirect_url, msg = hub.upload(request, post_files, documents, parties, location) - if redirect_url: - return errors, redirect_url - - if msg: - return msg, None + if redirect_url: + return errors, redirect_url + if msg: + return [msg], None return None, None @@ -51,7 +49,7 @@ def after_file_documents(request, initial=False): # Save dummy data for now. Eventually replace with data from CSO prefix = 'initial' if initial else 'final' - _save_response(user, f'{prefix}_filing_submitted', True) + _save_response(user, f'{prefix}_filing_submitted', 'True') if not initial: _save_response(user, f'final_filing_status', 'Submitted') diff --git a/edivorce/apps/core/views/efiling.py b/edivorce/apps/core/views/efiling.py index b1098e1e..29fa8178 100644 --- a/edivorce/apps/core/views/efiling.py +++ b/edivorce/apps/core/views/efiling.py @@ -37,6 +37,8 @@ def _submit_files(request, initial=False): if errors: next_page = original_step + if not isinstance(errors, list): + errors = [errors] for error in errors: messages.add_message(request, messages.ERROR, error) diff --git a/edivorce/apps/core/views/main.py b/edivorce/apps/core/views/main.py index 5970880b..13c1e3f5 100644 --- a/edivorce/apps/core/views/main.py +++ b/edivorce/apps/core/views/main.py @@ -191,6 +191,8 @@ def _add_error_messages(nav_step, request, responses_dict): 'The connection to the BC Government’s eFiling Hub is currently not working. ' 'This is a temporary problem. ' 'Please try again now and if this issue persists try again later.') + elif request.GET.get('message'): + messages.add_message(request, messages.ERROR, request.GET.get('message')) @login_required diff --git a/edivorce/settings/base.py b/edivorce/settings/base.py index 7f3e3309..53ee961e 100644 --- a/edivorce/settings/base.py +++ b/edivorce/settings/base.py @@ -185,7 +185,6 @@ DEBUG_TOOLBAR_CONFIG = { SECURE_BROWSER_XSS_FILTER = True # eFiling Hub settings -EFILING_HUB_ENABLED = False 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') diff --git a/edivorce/settings/local.py b/edivorce/settings/local.py index ed5140a2..99c38713 100644 --- a/edivorce/settings/local.py +++ b/edivorce/settings/local.py @@ -49,5 +49,3 @@ OIDC_OP_USER_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/open KEYCLOAK_LOGOUT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/logout' OIDC_RP_CLIENT_ID = 'edivorce-app' LOGIN_REDIRECT_URL = '/signin' - -EFILING_HUB_ENABLED = True