diff --git a/edivorce/apps/core/decorators.py b/edivorce/apps/core/decorators.py index 035280e2..1e467466 100644 --- a/edivorce/apps/core/decorators.py +++ b/edivorce/apps/core/decorators.py @@ -3,8 +3,8 @@ from django.shortcuts import redirect from django.urls import reverse from edivorce.apps.core.utils.question_step_mapping import pre_qual_step_question_mapping -from edivorce.apps.core.utils.step_completeness import get_missed_question_keys, is_complete -from edivorce.apps.core.utils.user_response import get_data_for_user, get_step_responses, questions_dict_for_step +from edivorce.apps.core.utils.step_completeness import is_complete +from edivorce.apps.core.utils.user_response import get_data_for_user, questions_dict_for_step base_url = settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME[:-1] diff --git a/edivorce/apps/core/models.py b/edivorce/apps/core/models.py index 38e89d27..59f147a9 100644 --- a/edivorce/apps/core/models.py +++ b/edivorce/apps/core/models.py @@ -4,7 +4,6 @@ from django.contrib import admin from django.db import models from django.db.models import F from django.urls import reverse -from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.contrib.auth.models import AbstractUser diff --git a/edivorce/apps/core/templates/dashboard/check_with_registry.html b/edivorce/apps/core/templates/dashboard/check_with_registry.html deleted file mode 100644 index b43cf073..00000000 --- a/edivorce/apps/core/templates/dashboard/check_with_registry.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}{{ block.super }}: Overview{% endblock %} - -{% block progress %}{% include "partials/dashnav.html" with active_page=active_page %}{% endblock %} - -{% block content %} - -

Check with registry to find out the status of your divorce application

- -

- Ask the registry staff when and how you should check in to find out if a judge has looked at your divorce document and has granted your divorce. -

- -

- The divorce will become effective on the 31st day after the order has been signed by the judge. - This doesn't mean the 31st day of that month. It means that from the date the judge signed your order, you count 31 days. - On the 31st day, your divorce becomes final. For example, if your divorce was granted on September 15, your divorce will become effective on October 16. -

- -
-

- You can't remarry until your divorce has been granted (that is, not until 31 days after the divorce order has been signed by the judge). -

-
- -{% endblock %} - -{% block backToDashboard %} - -{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} -{% block sidebarText %} - {% include "dashboard/partials/sidebar_help.html" %} -{% endblock %} \ No newline at end of file diff --git a/edivorce/apps/core/templates/dashboard/file_documents.html b/edivorce/apps/core/templates/dashboard/file_documents.html deleted file mode 100644 index f86a54c8..00000000 --- a/edivorce/apps/core/templates/dashboard/file_documents.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}{{ block.super }}: Overview{% endblock %} - -{% block progress %}{% include "partials/dashnav.html" with active_page=active_page %}{% endblock %} - -{% block content %} - -

File documents at registry

-

What happens at the registry?

-

At the counter, the registry staff will check your documents to make sure they've been completed properly.

-

- If you're not sure whether you've filled out the documents correctly, get some - legal advice before you file your documents — from - family duty counsel - or (in Vancouver) from the Vancouver - Justice Access Centre Self-Help and Information Services. -

-

If the registry is satisfied that your documents are in order, they will stamp the documents with the date, the court seal, and a file number.

-

You now have a divorce file open in the Supreme Court.

- - -{% endblock %} - -{% block backToDashboard %} - -{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} -{% block sidebarText %} - {% include "dashboard/partials/sidebar_help.html" %} -{% endblock %} \ No newline at end of file diff --git a/edivorce/apps/core/templates/dashboard/partials/sidebar_help.html b/edivorce/apps/core/templates/dashboard/partials/sidebar_help.html deleted file mode 100644 index 1cc78ad9..00000000 --- a/edivorce/apps/core/templates/dashboard/partials/sidebar_help.html +++ /dev/null @@ -1,19 +0,0 @@ -

How long does a divorce take?

-

- The time depends upon your individual circumstances (for example have you and your spouse agreed on how to divide - your property and debt). However, once you have completed the required forms, and filed them at a Supreme Court - registry, it can take 3 to 4 months to process your request. Please note times vary based on the registry. -

-

How much will it cost?

-

- You will have to pay a $290 court fee to get a divorce. -

-

- You may also choose to pay another $40 for an optional Certificate of Divorce Form (F56). If you ever want to - remarry, you'll need the Certificate of Divorce. -

-

- There are also some other costs involved in getting a divorce. If you choose to have your affidavits sworn at the - court registry, this will cost you $40 per affidavit. If you don't have a certified copy of your marriage - certificate or registration of marriage, you'll have to pay for this document as well. -

\ No newline at end of file diff --git a/edivorce/apps/core/templates/dashboard/wait.html b/edivorce/apps/core/templates/dashboard/wait.html deleted file mode 100644 index 2e4b1530..00000000 --- a/edivorce/apps/core/templates/dashboard/wait.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}{{ block.super }}: Overview{% endblock %} - -{% block progress %}{% include "partials/dashnav.html" with active_page=active_page %}{% endblock %} - -{% block content %} -

Wait while Judge reviews your request

-

- Once filed, forms will be passed to a judge. If the judge determines that you are entitled to a divorce, he or she will grant you a Divorce Order. -

-{% endblock %} - -{% block backToDashboard %} - -{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} -{% block sidebarText %} - {% include "dashboard/partials/sidebar_help.html" %} -{% endblock %} \ No newline at end of file diff --git a/edivorce/apps/core/templates/overview.html b/edivorce/apps/core/templates/overview.html index 294e9b2a..18f6f9d9 100644 --- a/edivorce/apps/core/templates/overview.html +++ b/edivorce/apps/core/templates/overview.html @@ -1,6 +1,5 @@ {% extends 'base.html' %} {% load step_order %} -{% load load_json %} {% block title %}{{ block.super }}: Overview{% endblock %} @@ -124,5 +123,23 @@ {% endblock %} {% block sidebarText %} - {% include "dashboard/partials/sidebar_help.html" %} +

How long does a divorce take?

+

+ The time depends upon your individual circumstances (for example have you and your spouse agreed on how to divide + your property and debt). However, once you have completed the required forms, and filed them at a Supreme Court + registry, it can take 3 to 4 months to process your request. Please note times vary based on the registry. +

+

How much will it cost?

+

+ You will have to pay a $290 court fee to get a divorce. +

+

+ You may also choose to pay another $40 for an optional Certificate of Divorce Form (F56). If you ever want to + remarry, you'll need the Certificate of Divorce. +

+

+ There are also some other costs involved in getting a divorce. If you choose to have your affidavits sworn at the + court registry, this will cost you $40 per affidavit. If you don't have a certified copy of your marriage + certificate or registration of marriage, you'll have to pay for this document as well. +

{% endblock %} diff --git a/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html index 11c3af7d..8d2c5909 100644 --- a/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html +++ b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html @@ -67,12 +67,12 @@ - {% include "partials/fact_sheet_excessive_debt.html" with debt_monthly_amount=0 %} + {% include "partials/fact_sheets/fact_sheet_excessive_debt.html" with debt_monthly_amount=0 %} {% multiple_values_to_list source=claimant_debts as debts %} {% for debt in debts %} - {% include "partials/fact_sheet_excessive_debt.html" with debt_name=debt.debt_name debt_terms=debt.debt_terms debt_monthly_amount=debt.debt_monthly_amount %} + {% include "partials/fact_sheets/fact_sheet_excessive_debt.html" with debt_name=debt.debt_name debt_terms=debt.debt_terms debt_monthly_amount=debt.debt_monthly_amount %} {% endfor %} @@ -99,12 +99,12 @@ - {% include "partials/fact_sheet_expense.html" with expense_amount=0 %} + {% include "partials/fact_sheets/fact_sheet_expense.html" with expense_amount=0 %} {% multiple_values_to_list source=claimant_expenses as expenses %} {% for expense in expenses %} - {% include "partials/fact_sheet_expense.html" with expense_name=expense.expense_name expense_amount=expense.expense_amount %} + {% include "partials/fact_sheets/fact_sheet_expense.html" with expense_name=expense.expense_name expense_amount=expense.expense_amount %} {% endfor %} @@ -133,12 +133,12 @@ - {% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" %} {% multiple_values_to_list source=supporting_non_dependents as non_dependents %} {% for non_dependent in non_dependents %} - {% include "partials/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" name=non_dependent.non_dependent_name relationship=non_dependent.non_dependent_relationship reason=non_dependent.non_dependent_reason %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="non_dependent_name" relationship_field="non_dependent_relationship" reason_field="non_dependent_reason" input_field_class="supporting-non-dependent-input-field" save_selector=".supporting-non-dependent-input-field" delete_button_class="btn-delete-supporting-non-dependent" name=non_dependent.non_dependent_name relationship=non_dependent.non_dependent_relationship reason=non_dependent.non_dependent_reason %} {% endfor %} @@ -168,12 +168,12 @@ - {% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" %} {% multiple_values_to_list source=supporting_dependents as dependents %} {% for dependent in dependents %} - {% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" name=dependent.supporting_dependent_name relationship=dependent.supporting_dependent_relationship reason=dependent.supporting_dependent_reason %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="supporting_dependent_name" relationship_field="supporting_dependent_relationship" reason_field="supporting_dependent_reason" input_field_class="supporting-dependent-input-field" delete_button_class="btn-delete-supporting-dependent" save_selector=".supporting-dependent-input-field" name=dependent.supporting_dependent_name relationship=dependent.supporting_dependent_relationship reason=dependent.supporting_dependent_reason %} {% endfor %} @@ -198,12 +198,12 @@ - {% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" save_selector=".supporting-disabled-input-field" %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" save_selector=".supporting-disabled-input-field" %} {% multiple_values_to_list source=supporting_disabled as dependents %} {% for dependent in dependents %} - {% include "partials/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" name=dependent.supporting_disabled_name relationship=dependent.supporting_disabled_relationship reason=dependent.supporting_disabled_reason save_selector=".supporting-disabled-input-field" %} + {% include "partials/fact_sheets/fact_sheet_supporting_person.html" with name_field="supporting_disabled_name" relationship_field="supporting_disabled_relationship" reason_field="supporting_disabled_reason" input_field_class="supporting-disabled-input-field" delete_button_class="btn-delete-supporting-disabled" name=dependent.supporting_disabled_name relationship=dependent.supporting_disabled_relationship reason=dependent.supporting_disabled_reason save_selector=".supporting-disabled-input-field" %} {% endfor %} @@ -239,12 +239,12 @@ - {% include "partials/fact_sheet_income_others.html" with income_others_amount=0 %} + {% include "partials/fact_sheets/fact_sheet_income_others.html" with income_others_amount=0 %} {% multiple_values_to_list source=income_others as incomes %} {% for income in incomes %} - {% include "partials/fact_sheet_income_others.html" with income_others_name=income.income_others_name income_others_amount=income.income_others_amount %} + {% include "partials/fact_sheets/fact_sheet_income_others.html" with income_others_name=income.income_others_name income_others_amount=income.income_others_amount %} {% endfor %} diff --git a/edivorce/apps/core/templates/partials/fact_sheet_excessive_debt.html b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_excessive_debt.html similarity index 100% rename from edivorce/apps/core/templates/partials/fact_sheet_excessive_debt.html rename to edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_excessive_debt.html diff --git a/edivorce/apps/core/templates/partials/fact_sheet_expense.html b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_expense.html similarity index 100% rename from edivorce/apps/core/templates/partials/fact_sheet_expense.html rename to edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_expense.html diff --git a/edivorce/apps/core/templates/partials/fact_sheet_income_others.html b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_income_others.html similarity index 100% rename from edivorce/apps/core/templates/partials/fact_sheet_income_others.html rename to edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_income_others.html diff --git a/edivorce/apps/core/templates/partials/fact_sheet_supporting_person.html b/edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_supporting_person.html similarity index 100% rename from edivorce/apps/core/templates/partials/fact_sheet_supporting_person.html rename to edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_supporting_person.html diff --git a/edivorce/apps/core/templates/partials/progress.html b/edivorce/apps/core/templates/partials/progress.html index 510c34b6..f8ce0629 100644 --- a/edivorce/apps/core/templates/partials/progress.html +++ b/edivorce/apps/core/templates/partials/progress.html @@ -1,5 +1,4 @@ {% load step_order %} -{% load load_json %}

Questionnaire

@@ -77,7 +76,7 @@ {% endif %} - {% if 'Spousal support' in want_which_orders|load_json or 'Spousal support' in which_orders.0.value|load_json %} + {% if derived.wants_spousal_support %} Step {% step_order step="support" %}
Spousal support
@@ -85,7 +84,7 @@
{% endif %} - {% if 'Division of property and debts' in want_which_orders|load_json or 'Division of property and debts' in which_orders.0.value|load_json %} + {% if derived.wants_property_division %} Step {% step_order step="property" %}
Property and debt
@@ -93,7 +92,7 @@
{% endif %} - {% if 'Other orders' in want_which_orders|load_json or 'Other orders' in which_orders.0.value|load_json %} + {% if derived.wants_other_orders %} Step {% step_order step="other_orders" %}
Other orders
diff --git a/edivorce/apps/core/templates/pdf/form52.html b/edivorce/apps/core/templates/pdf/form52.html index 1cdf54b5..250d24f5 100644 --- a/edivorce/apps/core/templates/pdf/form52.html +++ b/edivorce/apps/core/templates/pdf/form52.html @@ -2,7 +2,6 @@ {% load composites %} {% load input_field %} {% load format_utils %} -{% load load_json %} diff --git a/edivorce/apps/core/templates/question/06_children_facts.html b/edivorce/apps/core/templates/question/06_children_facts.html index 3b99450b..14b49d7a 100644 --- a/edivorce/apps/core/templates/question/06_children_facts.html +++ b/edivorce/apps/core/templates/question/06_children_facts.html @@ -3,7 +3,6 @@ {% load format_utils %} {% load step_order %} {% load format_utils %} -{% load load_json %} {% block title %}{{ block.super }}: Your Children {% endblock %} 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 a568aeaa..3d923e00 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -2,7 +2,6 @@ {% load static %} {% load input_field %} {% load step_order %} -{% load load_json %} {% load format_utils %} {% block title %}{{ block.super }}: Your Children {% endblock %} @@ -18,7 +17,7 @@
- - {% if 'Child support' in want_which_orders|load_json %} + + {% if derived.wants_child_support %} {% else %} @@ -332,7 +331,7 @@ {% endif %} {# DIV-963: Show/hide logic and text update will be handled by JavaScript function updateChildSupportActQuestion() #} -
+

Please indicate which act(s) you are asking for child support under. {% if child_support_act_error %}{% include 'partials/required.html' %}{% endif %}

diff --git a/edivorce/apps/core/templates/question/06_children_your_children.html b/edivorce/apps/core/templates/question/06_children_your_children.html index 4f350b99..3b97fb34 100644 --- a/edivorce/apps/core/templates/question/06_children_your_children.html +++ b/edivorce/apps/core/templates/question/06_children_your_children.html @@ -2,7 +2,6 @@ {% load input_field %} {% load format_utils %} {% load step_order %} -{% load load_json %} {% block title %}{{ block.super }}: Your Children{% endblock %} @@ -27,7 +26,7 @@ and are independent.

-{% if 'Child support' not in want_which_orders|load_json %} +{% if derived.wants_child_support %}

Please note: Not asking for child support but have children

Even though you are not asking for an order for child support, you will still need to answer some questions diff --git a/edivorce/apps/core/templates/question/12_review.html b/edivorce/apps/core/templates/question/12_review.html index 287f28d3..a1488767 100644 --- a/edivorce/apps/core/templates/question/12_review.html +++ b/edivorce/apps/core/templates/question/12_review.html @@ -1,7 +1,6 @@ {% extends 'base.html' %} {% load input_field %} {% load step_order %} -{% load load_json %} {% block title %}{{ block.super }}: Review{% endblock %} diff --git a/edivorce/apps/core/templatetags/format_utils.py b/edivorce/apps/core/templatetags/format_utils.py index ec307c20..8d9f8993 100644 --- a/edivorce/apps/core/templatetags/format_utils.py +++ b/edivorce/apps/core/templatetags/format_utils.py @@ -175,16 +175,6 @@ def child_or_children(value): return '%d children' -@register.filter -def integer(value): - """ Return value as an int or nothing """ - - try: - return int(float(value)) - except ValueError: - return '' - - @register.simple_tag() def lookup(obj, property): """ Return the value of a dynamic property within an object""" diff --git a/edivorce/apps/core/templatetags/input_field.py b/edivorce/apps/core/templatetags/input_field.py index 5fc9daa4..2f741fa3 100644 --- a/edivorce/apps/core/templatetags/input_field.py +++ b/edivorce/apps/core/templatetags/input_field.py @@ -134,17 +134,6 @@ def additional_attributes(**kwargs): return attributes -@register.simple_tag -def check_list(source, value): - """ - Check if given value is in the given source - """ - try: - return value in json.loads(source) - except: - return False - - @register.simple_tag def multiple_values_to_list(source): try: diff --git a/edivorce/apps/core/templatetags/load_json.py b/edivorce/apps/core/templatetags/load_json.py deleted file mode 100644 index 42380fb3..00000000 --- a/edivorce/apps/core/templatetags/load_json.py +++ /dev/null @@ -1,9 +0,0 @@ -import json - -from django import template - -register = template.Library() - -@register.filter -def load_json(data): - return json.loads(data) \ No newline at end of file diff --git a/edivorce/apps/core/templatetags/step_order.py b/edivorce/apps/core/templatetags/step_order.py index 8263cde1..f0471af6 100644 --- a/edivorce/apps/core/templatetags/step_order.py +++ b/edivorce/apps/core/templatetags/step_order.py @@ -3,8 +3,12 @@ import json from django.urls import reverse -from ..utils.template_step_order import template_step_order, template_sub_step_order, get_step_name, \ - get_step_or_sub_step_name +from ..utils.template_step_order import ( + template_step_order, + template_sub_step_order, + get_step_name, + get_step_or_sub_step_name, +) register = template.Library() diff --git a/edivorce/apps/core/tests/test_efiling_packaging.py b/edivorce/apps/core/tests/test_efiling_packaging.py index 20419444..2f0f45ab 100644 --- a/edivorce/apps/core/tests/test_efiling_packaging.py +++ b/edivorce/apps/core/tests/test_efiling_packaging.py @@ -1,14 +1,9 @@ -import json -from unittest import mock - from django.contrib.sessions.middleware import SessionMiddleware -from django.core.exceptions import PermissionDenied from django.test import TransactionTestCase from django.test.client import RequestFactory from django.core.files.uploadedfile import SimpleUploadedFile -from edivorce.apps.core.utils.efiling_submission import EFilingSubmission -from edivorce.apps.core.utils.efiling_packaging import EFilingPackaging, PACKAGE_PARTY_FORMAT, PACKAGE_DOCUMENT_FORMAT +from edivorce.apps.core.utils.efiling_packaging import EFilingPackaging, PACKAGE_DOCUMENT_FORMAT class EFilingPackagingTests(TransactionTestCase): diff --git a/edivorce/apps/core/tests/test_efiling_submission.py b/edivorce/apps/core/tests/test_efiling_submission.py index d2db430f..5910b38e 100644 --- a/edivorce/apps/core/tests/test_efiling_submission.py +++ b/edivorce/apps/core/tests/test_efiling_submission.py @@ -2,13 +2,11 @@ import json from unittest import mock from django.contrib.sessions.middleware import SessionMiddleware -from django.core.exceptions import PermissionDenied from django.test import TransactionTestCase from django.test.client import RequestFactory -from django.core.files.uploadedfile import SimpleUploadedFile from edivorce.apps.core.utils.efiling_submission import EFilingSubmission -from edivorce.apps.core.utils.efiling_packaging import EFilingPackaging, PACKAGE_PARTY_FORMAT, PACKAGE_DOCUMENT_FORMAT +from edivorce.apps.core.utils.efiling_packaging import EFilingPackaging SAMPLE_TOKEN_RESPONSE = { "access_token": "klkadlfjadsfkj", diff --git a/edivorce/apps/poc/__init__.py b/edivorce/apps/poc/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/edivorce/apps/poc/migrations/0001_initial.py b/edivorce/apps/poc/migrations/0001_initial.py deleted file mode 100644 index 6c57a46c..00000000 --- a/edivorce/apps/poc/migrations/0001_initial.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 2.2.15 on 2020-08-23 05:10 - -from django.db import migrations, models -import edivorce.apps.core.redis - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Document', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file', models.FileField(storage=edivorce.apps.core.redis.RedisStorage, upload_to='docs_%Y_%m_%d_%H_%M_%S')), - ], - ), - ] diff --git a/edivorce/apps/poc/migrations/0002_auto_20200823_0606.py b/edivorce/apps/poc/migrations/0002_auto_20200823_0606.py deleted file mode 100644 index 7292e66b..00000000 --- a/edivorce/apps/poc/migrations/0002_auto_20200823_0606.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.15 on 2020-08-23 06:06 - -from django.db import migrations, models -import edivorce.apps.core.redis - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='filename', - field=models.CharField(max_length=128, null=True), - ), - migrations.AlterField( - model_name='document', - name='file', - field=models.FileField(storage=edivorce.apps.core.redis.RedisStorage(), upload_to=edivorce.apps.core.redis.generate_unique_filename), - ), - ] diff --git a/edivorce/apps/poc/migrations/0003_auto_20200915_1645.py b/edivorce/apps/poc/migrations/0003_auto_20200915_1645.py deleted file mode 100644 index 657970ab..00000000 --- a/edivorce/apps/poc/migrations/0003_auto_20200915_1645.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-15 23:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0002_auto_20200823_0606'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='docType', - field=models.CharField(max_length=4, null=True), - ), - migrations.AddField( - model_name='document', - name='partyId', - field=models.IntegerField(default=0), - ), - ] diff --git a/edivorce/apps/poc/migrations/0004_auto_20200917_1008.py b/edivorce/apps/poc/migrations/0004_auto_20200917_1008.py deleted file mode 100644 index 216eea64..00000000 --- a/edivorce/apps/poc/migrations/0004_auto_20200917_1008.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-17 17:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0003_auto_20200915_1645'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='docType', - field=models.CharField(blank=True, max_length=4, null=True), - ), - ] diff --git a/edivorce/apps/poc/migrations/0005_auto_20200921_1255.py b/edivorce/apps/poc/migrations/0005_auto_20200921_1255.py deleted file mode 100644 index e790e565..00000000 --- a/edivorce/apps/poc/migrations/0005_auto_20200921_1255.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-21 19:55 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_auto_20200903_2328'), - ('poc', '0004_auto_20200917_1008'), - ] - - operations = [ - migrations.RenameField( - model_name='document', - old_name='docType', - new_name='doc_type', - ), - migrations.RenameField( - model_name='document', - old_name='partyId', - new_name='party_id', - ), - migrations.AddField( - model_name='document', - name='bceid_user', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='uploads', to='core.BceidUser'), - ), - migrations.AddField( - model_name='document', - name='length', - field=models.IntegerField(default=0), - ), - migrations.AlterUniqueTogether( - name='document', - unique_together={('bceid_user', 'doc_type', 'party_id', 'filename', 'length')}, - ), - migrations.RunSQL( - sql='delete from poc_document' - ) - ] diff --git a/edivorce/apps/poc/migrations/0006_auto_20200921_1301.py b/edivorce/apps/poc/migrations/0006_auto_20200921_1301.py deleted file mode 100644 index 5258db6f..00000000 --- a/edivorce/apps/poc/migrations/0006_auto_20200921_1301.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-21 20:01 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0005_auto_20200921_1255'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='bceid_user', - field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='uploads', to='core.BceidUser'), - preserve_default=False, - ), - ] diff --git a/edivorce/apps/poc/migrations/0007_auto_20200921_1523.py b/edivorce/apps/poc/migrations/0007_auto_20200921_1523.py deleted file mode 100644 index 4e06adb5..00000000 --- a/edivorce/apps/poc/migrations/0007_auto_20200921_1523.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-21 22:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0006_auto_20200921_1301'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='order', - field=models.IntegerField(default=1), - ), - migrations.AddField( - model_name='document', - name='rotation', - field=models.IntegerField(default=0), - ), - ] diff --git a/edivorce/apps/poc/migrations/0008_auto_20200922_1027.py b/edivorce/apps/poc/migrations/0008_auto_20200922_1027.py deleted file mode 100644 index 75920d31..00000000 --- a/edivorce/apps/poc/migrations/0008_auto_20200922_1027.py +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-22 17:27 - -import datetime -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0020_auto_20200903_2328'), - ('poc', '0007_auto_20200921_1523'), - ] - - operations = [ - migrations.RenameField( - model_name='document', - old_name='party_id', - new_name='party_code', - ), - migrations.RenameField( - model_name='document', - old_name='length', - new_name='size', - ), - migrations.RenameField( - model_name='document', - old_name='order', - new_name='sort_order', - ), - migrations.AddField( - model_name='document', - name='date_uploaded', - field=models.DateTimeField(default=datetime.datetime.now), - ), - migrations.AlterUniqueTogether( - name='document', - unique_together={('bceid_user', 'doc_type', 'party_code', 'filename', 'size')}, - ), - ] diff --git a/edivorce/apps/poc/migrations/0009_auto_20200922_1033.py b/edivorce/apps/poc/migrations/0009_auto_20200922_1033.py deleted file mode 100644 index 1d1667a1..00000000 --- a/edivorce/apps/poc/migrations/0009_auto_20200922_1033.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-22 17:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0008_auto_20200922_1027'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='date_uploaded', - field=models.DateTimeField(auto_now_add=True), - ), - ] diff --git a/edivorce/apps/poc/migrations/0010_delete_document.py b/edivorce/apps/poc/migrations/0010_delete_document.py deleted file mode 100644 index 1869a57b..00000000 --- a/edivorce/apps/poc/migrations/0010_delete_document.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 2.2.15 on 2020-09-24 00:37 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('poc', '0009_auto_20200922_1033'), - ] - - operations = [ - migrations.DeleteModel( - name='Document', - ), - ] diff --git a/edivorce/apps/poc/migrations/__init__.py b/edivorce/apps/poc/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/edivorce/apps/poc/templates/hub.html b/edivorce/apps/poc/templates/hub.html deleted file mode 100644 index ef8e7010..00000000 --- a/edivorce/apps/poc/templates/hub.html +++ /dev/null @@ -1,46 +0,0 @@ -{% extends 'base.html' %} -{% load input_field %} -{% load step_order %} -{% load load_json %} - -{% block title %}{{ block.super }}: POC{% endblock %} - -{% block progress %}{% include "poc-sidebar.html" %}{% endblock %} - -{% block content %} -

Proof of Concept:Efiling Hub Integration

- -
- {% csrf_token %} - -
-

Specify files to upload to the eFiling Hub.

-
-
{{ form.upload_file }}
- {% if form.upload_file.errors %} - - {% for err in form.upload_file.errors %}{{ err }}{% endfor %} - - {% endif %} -
-
- -
- -
- -
- -{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} - -{% block sidebar %} - -{% endblock %} diff --git a/edivorce/apps/poc/templates/poc-sidebar.html b/edivorce/apps/poc/templates/poc-sidebar.html deleted file mode 100644 index 3901d09b..00000000 --- a/edivorce/apps/poc/templates/poc-sidebar.html +++ /dev/null @@ -1,19 +0,0 @@ -{% load step_order %} -{% load load_json %} - -
diff --git a/edivorce/apps/poc/templates/poc/document_confirm_delete.html b/edivorce/apps/poc/templates/poc/document_confirm_delete.html deleted file mode 100644 index cfe6caba..00000000 --- a/edivorce/apps/poc/templates/poc/document_confirm_delete.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'base.html' %} -{% load input_field %} -{% load step_order %} -{% load load_json %} - -{% block title %}{{ block.super }}: POC{% endblock %} - -{% block progress %}{% include "poc-sidebar.html" %}{% endblock %} - -{% block content %} -
{% csrf_token %} -

Are you sure you want to delete "{{ object }}"?

- -
-{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} - -{% block sidebar %} - -{% endblock %} diff --git a/edivorce/apps/poc/templates/scan.html b/edivorce/apps/poc/templates/scan.html deleted file mode 100644 index efaa86f0..00000000 --- a/edivorce/apps/poc/templates/scan.html +++ /dev/null @@ -1,47 +0,0 @@ -{% extends 'base.html' %} -{% load input_field %} -{% load step_order %} -{% load load_json %} - -{% block title %}{{ block.super }}: POC{% endblock %} - -{% block progress %}{% include "poc-sidebar.html" %}{% endblock %} - -{% block content %} -

Proof of Concept:File scanning

- -
- {% csrf_token %} - -
-

Upload a file to test virus scanning.

-
-
{{ form.upload_file }}
- {% if form.upload_file.errors %} - - {% for err in form.upload_file.errors %}{{ err }}{% endfor %} - - {% endif %} - {% if validation_success %}No viruses found{% endif %} -
-
- -
- -
- -
- -{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} - -{% block sidebar %} - -{% endblock %} diff --git a/edivorce/apps/poc/templates/storage.html b/edivorce/apps/poc/templates/storage.html deleted file mode 100644 index 18892ac1..00000000 --- a/edivorce/apps/poc/templates/storage.html +++ /dev/null @@ -1,72 +0,0 @@ -{% extends 'base.html' %} -{% load input_field %} -{% load step_order %} -{% load load_json %} - -{% block title %}{{ block.super }}: POC{% endblock %} - -{% block progress %}{% include "poc-sidebar.html" %}{% endblock %} - -{% block content %} -

Proof of Concept:File storage

- -
- {% csrf_token %} - -
-

Upload a file to store in Redis.

-
-
{{ form.file }}
- {% if form.file.errors %} - - {% for err in form.file.errors %}{{ err }}{% endfor %} - - {% endif %} - {% if validation_success %}No viruses found{% endif %} -
-
- -
- -
- -
-

Stored documents

- - - - - - - - - - {% for document in documents %} - - - - - - {% endfor %} - -
File nameRedis key
- - {{ document.filename|default:'' }} - - {{ document.file.name }}Delete
-
- -
-{% endblock %} - -{% block formbuttons %} - -{% endblock %} - -{% block sidebarNav %} - -{% endblock %} - -{% block sidebar %} - -{% endblock %} diff --git a/edivorce/apps/poc/urls.py b/edivorce/apps/poc/urls.py deleted file mode 100644 index d5bd7980..00000000 --- a/edivorce/apps/poc/urls.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.conf.urls import url -from django.contrib.auth.decorators import login_required - -from edivorce.apps.poc import views - -urlpatterns = [ - url(r'scan', login_required(views.UploadScan.as_view()), name="poc-scan"), - url(r'hub', login_required(views.EFilingSubmissionUpload.as_view()), name="poc-hub"), - url(r'storage/doc/(?P\d+)', login_required(views.view_document_file), name="poc-storage-download"), - url(r'storage/delete/(?P\d+)', login_required(views.UploadStorageDelete.as_view()), name="poc-storage-delete"), - url(r'storage', login_required(views.UploadStorage.as_view()), name="poc-storage"), -] \ No newline at end of file diff --git a/edivorce/apps/poc/views.py b/edivorce/apps/poc/views.py deleted file mode 100644 index e2858bbe..00000000 --- a/edivorce/apps/poc/views.py +++ /dev/null @@ -1,112 +0,0 @@ -import logging - -from django.shortcuts import render -from django.utils.decorators import method_decorator -from django.views.decorators.csrf import csrf_exempt -from django.views.generic.edit import FormView, CreateView, DeleteView -from django import forms -from django.http import HttpResponse -from django.conf import settings - -from edivorce.apps.core.utils.efiling_submission import EFilingSubmission -from edivorce.apps.core.utils.efiling_packaging import PACKAGE_PARTY_FORMAT -from edivorce.apps.core.validators import file_scan_validation -from edivorce.apps.core.models import Document - -logger = logging.getLogger(__name__) - -""" -Everything in this file is considered as proof of concept work and should not be used for production code. -""" - - -class UploadScanForm(forms.Form): - upload_file = forms.FileField(validators=[file_scan_validation]) - - -class MultipleUploadForm(forms.Form): - upload_file = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True})) - - -class UploadScan(FormView): - form_class = UploadScanForm - template_name = "scan.html" - - def form_valid(self, form): - context = self.get_context_data() - context['validation_success'] = True - return render(self.request, self.template_name, context) - - -class UploadStorage(CreateView): - model = Document - fields = ['file', 'doc_type', 'party_code'] - template_name = "storage.html" - success_url = settings.FORCE_SCRIPT_NAME + 'poc/storage' - - @method_decorator(csrf_exempt) - def dispatch(self, request, *args, **kwargs): - return super(UploadStorage, self).dispatch(request, *args, **kwargs) - - def get_context_data(self, **kwargs): - kwargs['documents'] = Document.objects.all() - return super(UploadStorage, self).get_context_data(**kwargs) - - def form_valid(self, form): - obj = form.save(commit=False) - obj.bceid_user = self.request.user - return super(UploadStorage, self).form_valid(form) - - -class UploadStorageDelete(DeleteView): - model = Document - success_url = settings.FORCE_SCRIPT_NAME + 'poc/storage' - template_name = 'poc/document_confirm_delete.html' - - -def view_document_file(request, document_id): - doc = Document.objects.get(id=document_id) - - content_type = 'application/pdf' if 'pdf' in doc.file.name else 'image/jpeg' - - response = HttpResponse(doc.file.read(), content_type=content_type) - response['Content-Disposition'] = 'attachment; filename={}'.format(doc.filename) - - return response - - -class EFilingSubmissionUpload(FormView): - form_class = MultipleUploadForm - template_name = 'hub.html' - success_url = '/poc/hub' - - def post(self, request, *args, **kwargs): - form_class = self.get_form_class() - form = self.get_form(form_class) - files = request.FILES.getlist('upload_file') - if form.is_valid(): - # NOTE: this does not do any validation for file types .. make sure that is done - # prior to sending to eFiling Hub - post_files = [] - if files: - for file in files: - post_files.append(('files', (file.name, file.read()))) - - # generate the list of parties to send to eFiling Hub - parties = [] - for i in range(0, 2): - party = PACKAGE_PARTY_FORMAT.copy() - party['firstName'] = 'Party {}'.format(i) - party['lastName'] = 'Test' - parties.append(party) - - hub = EFilingSubmission(initial_filing=True) - redirect, msg = hub.upload(request, post_files, parties=parties) - if redirect: - self.success_url = redirect - - return self.form_valid(form) - - form.add_error('upload_file', msg) - - return self.form_invalid(form) diff --git a/edivorce/settings/base.py b/edivorce/settings/base.py index 05cf69e3..d67035c4 100644 --- a/edivorce/settings/base.py +++ b/edivorce/settings/base.py @@ -58,11 +58,6 @@ INSTALLED_APPS = ( 'graphene_django', ) -# add the POC app only if applicable -if ENVIRONMENT in ['localdev', 'dev', 'test']: - INSTALLED_APPS += ( - 'edivorce.apps.poc', - ) MIDDLEWARE = ( 'edivorce.apps.core.middleware.basicauth_middleware.BasicAuthMiddleware', diff --git a/edivorce/urls.py b/edivorce/urls.py index 01ead84f..7eff8ca0 100644 --- a/edivorce/urls.py +++ b/edivorce/urls.py @@ -12,7 +12,6 @@ urlpatterns = [] if settings.ENVIRONMENT in ['localdev', 'dev', 'test']: import debug_toolbar urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)),) - urlpatterns.append(url(r'^poc/', include('edivorce.apps.poc.urls'))) urlpatterns.append(path('api/graphql/', csrf_exempt(PrivateGraphQLView.as_view(graphiql=True, schema=graphql_schema)), name='graphql')) else: urlpatterns.append(path('api/graphql/', csrf_exempt(PrivateGraphQLView.as_view(graphiql=False, schema=graphql_schema)), name='graphql'))