Browse Source

Merge pull request #157 from bcgov/div-1247

DIV-1247: Delete unused code
pull/172/head
Arianne 5 years ago
committed by GitHub
parent
commit
7c57d14af8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 51 additions and 786 deletions
  1. +2
    -2
      edivorce/apps/core/decorators.py
  2. +0
    -1
      edivorce/apps/core/models.py
  3. +0
    -42
      edivorce/apps/core/templates/dashboard/check_with_registry.html
  4. +0
    -38
      edivorce/apps/core/templates/dashboard/file_documents.html
  5. +0
    -19
      edivorce/apps/core/templates/dashboard/partials/sidebar_help.html
  6. +0
    -27
      edivorce/apps/core/templates/dashboard/wait.html
  7. +19
    -2
      edivorce/apps/core/templates/overview.html
  8. +12
    -12
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html
  9. +0
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_excessive_debt.html
  10. +0
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_expense.html
  11. +0
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_income_others.html
  12. +0
    -0
      edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_supporting_person.html
  13. +3
    -4
      edivorce/apps/core/templates/partials/progress.html
  14. +0
    -1
      edivorce/apps/core/templates/pdf/form52.html
  15. +0
    -1
      edivorce/apps/core/templates/question/06_children_facts.html
  16. +6
    -7
      edivorce/apps/core/templates/question/06_children_what_for.html
  17. +1
    -2
      edivorce/apps/core/templates/question/06_children_your_children.html
  18. +0
    -1
      edivorce/apps/core/templates/question/12_review.html
  19. +0
    -10
      edivorce/apps/core/templatetags/format_utils.py
  20. +0
    -11
      edivorce/apps/core/templatetags/input_field.py
  21. +0
    -9
      edivorce/apps/core/templatetags/load_json.py
  22. +6
    -2
      edivorce/apps/core/templatetags/step_order.py
  23. +1
    -6
      edivorce/apps/core/tests/test_efiling_packaging.py
  24. +1
    -3
      edivorce/apps/core/tests/test_efiling_submission.py
  25. +0
    -0
      edivorce/apps/poc/__init__.py
  26. +0
    -22
      edivorce/apps/poc/migrations/0001_initial.py
  27. +0
    -24
      edivorce/apps/poc/migrations/0002_auto_20200823_0606.py
  28. +0
    -23
      edivorce/apps/poc/migrations/0003_auto_20200915_1645.py
  29. +0
    -18
      edivorce/apps/poc/migrations/0004_auto_20200917_1008.py
  30. +0
    -42
      edivorce/apps/poc/migrations/0005_auto_20200921_1255.py
  31. +0
    -20
      edivorce/apps/poc/migrations/0006_auto_20200921_1301.py
  32. +0
    -23
      edivorce/apps/poc/migrations/0007_auto_20200921_1523.py
  33. +0
    -39
      edivorce/apps/poc/migrations/0008_auto_20200922_1027.py
  34. +0
    -18
      edivorce/apps/poc/migrations/0009_auto_20200922_1033.py
  35. +0
    -16
      edivorce/apps/poc/migrations/0010_delete_document.py
  36. +0
    -0
      edivorce/apps/poc/migrations/__init__.py
  37. +0
    -46
      edivorce/apps/poc/templates/hub.html
  38. +0
    -19
      edivorce/apps/poc/templates/poc-sidebar.html
  39. +0
    -27
      edivorce/apps/poc/templates/poc/document_confirm_delete.html
  40. +0
    -47
      edivorce/apps/poc/templates/scan.html
  41. +0
    -72
      edivorce/apps/poc/templates/storage.html
  42. +0
    -12
      edivorce/apps/poc/urls.py
  43. +0
    -112
      edivorce/apps/poc/views.py
  44. +0
    -5
      edivorce/settings/base.py
  45. +0
    -1
      edivorce/urls.py

+ 2
- 2
edivorce/apps/core/decorators.py View File

@ -3,8 +3,8 @@ from django.shortcuts import redirect
from django.urls import reverse from django.urls import reverse
from edivorce.apps.core.utils.question_step_mapping import pre_qual_step_question_mapping 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] base_url = settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME[:-1]


+ 0
- 1
edivorce/apps/core/models.py View File

@ -4,7 +4,6 @@ from django.contrib import admin
from django.db import models from django.db import models
from django.db.models import F from django.db.models import F
from django.urls import reverse from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import AbstractUser from django.contrib.auth.models import AbstractUser


+ 0
- 42
edivorce/apps/core/templates/dashboard/check_with_registry.html View File

@ -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 %}
<h1>Check with registry to find out the status of your divorce application</h1>
<p>
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.
</p>
<p>
The divorce will become effective on the 31st day after the order has been signed by the judge.
<b>This doesn't mean the 31st day of that month</b>. 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.
</p>
<div class="bg-danger">
<p>
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).
</p>
</div>
{% endblock %}
{% block backToDashboard %}
<!-- no back to dashboard -->
{% endblock %}
{% block formbuttons %}
<!-- no button -->
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebarText %}
{% include "dashboard/partials/sidebar_help.html" %}
{% endblock %}

+ 0
- 38
edivorce/apps/core/templates/dashboard/file_documents.html View File

@ -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 %}
<h1>File documents at registry</h1>
<h3>What happens at the registry?</h3>
<p>At the counter, the registry staff will check your documents to make sure they've been completed properly.</p>
<p>
If you're not sure whether you've filled out the documents correctly, get some
<a href="https://familylaw.lss.bc.ca/help/who_LegalAdvice.php" target="_blank">legal advice</a> before you file your documents — from
<a href="https://familylaw.lss.bc.ca/help/who_FamilyDutyCounsel.php" target="_blank">family duty counsel</a>
or (in Vancouver) from the Vancouver
<a href="https://familylaw.lss.bc.ca/help/jacSelfHelpAndInfoServices.php" target="_blank">Justice Access Centre</a> Self-Help and Information Services.
</p>
<p>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.</p>
<p>You now have a divorce file open in the Supreme Court.</p>
{% endblock %}
{% block backToDashboard %}
<!-- no back to dashboard -->
{% endblock %}
{% block formbuttons %}
<!-- no button -->
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebarText %}
{% include "dashboard/partials/sidebar_help.html" %}
{% endblock %}

+ 0
- 19
edivorce/apps/core/templates/dashboard/partials/sidebar_help.html View File

@ -1,19 +0,0 @@
<h3>How long does a divorce take?</h3>
<p>
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 <b>3 to 4 months</b> to process your request. Please note times vary based on the registry.
</p>
<h3>How much will it cost?</h3>
<p>
You will have to pay a $290 court fee to get a divorce.
</p>
<p>
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.
</p>
<p>
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.
</p>

+ 0
- 27
edivorce/apps/core/templates/dashboard/wait.html View File

@ -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 %}
<h1>Wait while Judge reviews your request</h1>
<p>
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.
</p>
{% endblock %}
{% block backToDashboard %}
<!-- no back to dashboard -->
{% endblock %}
{% block formbuttons %}
<!-- no button -->
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebarText %}
{% include "dashboard/partials/sidebar_help.html" %}
{% endblock %}

+ 19
- 2
edivorce/apps/core/templates/overview.html View File

@ -1,6 +1,5 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load step_order %} {% load step_order %}
{% load load_json %}
{% block title %}{{ block.super }}: Overview{% endblock %} {% block title %}{{ block.super }}: Overview{% endblock %}
@ -124,5 +123,23 @@
{% endblock %} {% endblock %}
{% block sidebarText %} {% block sidebarText %}
{% include "dashboard/partials/sidebar_help.html" %}
<h3>How long does a divorce take?</h3>
<p>
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 <b>3 to 4 months</b> to process your request. Please note times vary based on the registry.
</p>
<h3>How much will it cost?</h3>
<p>
You will have to pay a $290 court fee to get a divorce.
</p>
<p>
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.
</p>
<p>
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.
</p>
{% endblock %} {% endblock %}

+ 12
- 12
edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_e.html View File

@ -67,12 +67,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="debt-group" hidden> <tr class="debt-group" hidden>
{% 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 %}
</tr> </tr>
{% multiple_values_to_list source=claimant_debts as debts %} {% multiple_values_to_list source=claimant_debts as debts %}
{% for debt in debts %} {% for debt in debts %}
<tr class="debt-item-row"> <tr class="debt-item-row">
{% 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 %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -99,12 +99,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="expense-group" hidden> <tr class="expense-group" hidden>
{% include "partials/fact_sheet_expense.html" with expense_amount=0 %}
{% include "partials/fact_sheets/fact_sheet_expense.html" with expense_amount=0 %}
</tr> </tr>
{% multiple_values_to_list source=claimant_expenses as expenses %} {% multiple_values_to_list source=claimant_expenses as expenses %}
{% for expense in expenses %} {% for expense in expenses %}
<tr class="expense-item-row"> <tr class="expense-item-row">
{% 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 %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -133,12 +133,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="supporting-non-dependent-group" hidden> <tr class="supporting-non-dependent-group" hidden>
{% 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" %}
</tr> </tr>
{% multiple_values_to_list source=supporting_non_dependents as non_dependents %} {% multiple_values_to_list source=supporting_non_dependents as non_dependents %}
{% for non_dependent in non_dependents %} {% for non_dependent in non_dependents %}
<tr class="supporting-non-dependent-item-row"> <tr class="supporting-non-dependent-item-row">
{% 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 %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -168,12 +168,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="supporting-dependent-group" hidden> <tr class="supporting-dependent-group" hidden>
{% 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" %}
</tr> </tr>
{% multiple_values_to_list source=supporting_dependents as dependents %} {% multiple_values_to_list source=supporting_dependents as dependents %}
{% for dependent in dependents %} {% for dependent in dependents %}
<tr class="supporting-dependent-item-row"> <tr class="supporting-dependent-item-row">
{% 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 %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -198,12 +198,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="supporting-disabled-group" hidden> <tr class="supporting-disabled-group" hidden>
{% 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" %}
</tr> </tr>
{% multiple_values_to_list source=supporting_disabled as dependents %} {% multiple_values_to_list source=supporting_disabled as dependents %}
{% for dependent in dependents %} {% for dependent in dependents %}
<tr class="supporting-disabled-item-row"> <tr class="supporting-disabled-item-row">
{% 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" %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -239,12 +239,12 @@
</thead> </thead>
<tbody> <tbody>
<tr class="income-others-group" hidden> <tr class="income-others-group" hidden>
{% 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 %}
</tr> </tr>
{% multiple_values_to_list source=income_others as incomes %} {% multiple_values_to_list source=income_others as incomes %}
{% for income in incomes %} {% for income in incomes %}
<tr class="income-others-item-row"> <tr class="income-others-item-row">
{% 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 %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>


edivorce/apps/core/templates/partials/fact_sheet_excessive_debt.html → edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_excessive_debt.html View File


edivorce/apps/core/templates/partials/fact_sheet_expense.html → edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_expense.html View File


edivorce/apps/core/templates/partials/fact_sheet_income_others.html → edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_income_others.html View File


edivorce/apps/core/templates/partials/fact_sheet_supporting_person.html → edivorce/apps/core/templates/partials/fact_sheets/fact_sheet_supporting_person.html View File


+ 3
- 4
edivorce/apps/core/templates/partials/progress.html View File

@ -1,5 +1,4 @@
{% load step_order %} {% load step_order %}
{% load load_json %}
<div class="col-flex progress-column"> <div class="col-flex progress-column">
<h4>Questionnaire</h4> <h4>Questionnaire</h4>
@ -77,7 +76,7 @@
</ul> </ul>
{% endif %} {% 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 %}
<a href="{% url 'question_steps' 'support' %}" class="progress-question {% if step_status.spousal_support == 'Completed' %} complete {% endif %} {% if active_page == 'support' %} active {% endif %}"> <a href="{% url 'question_steps' 'support' %}" class="progress-question {% if step_status.spousal_support == 'Completed' %} complete {% endif %} {% if active_page == 'support' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-life-ring" aria-hidden="true"></i></span> <span class="progress-icon"><i class="fa fa-life-ring" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step {% step_order step="support" %}</small><br />Spousal support</span> <span class="progress-content"><small>Step {% step_order step="support" %}</small><br />Spousal support</span>
@ -85,7 +84,7 @@
</a> </a>
{% endif %} {% 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 %}
<a href="{% url 'question_steps' 'property' %}" class="progress-question {% if step_status.property_and_debt == 'Completed' %} complete {% endif %} {% if active_page == 'property' %} active {% endif %}"> <a href="{% url 'question_steps' 'property' %}" class="progress-question {% if step_status.property_and_debt == 'Completed' %} complete {% endif %} {% if active_page == 'property' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-home" aria-hidden="true"></i></span> <span class="progress-icon"><i class="fa fa-home" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step {% step_order step="property" %}</small><br />Property and debt</span> <span class="progress-content"><small>Step {% step_order step="property" %}</small><br />Property and debt</span>
@ -93,7 +92,7 @@
</a> </a>
{% endif %} {% 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 %}
<a href="{% url 'question_steps' 'other_orders' %}" class="progress-question {% if step_status.other_orders == 'Completed' %} complete {% endif %} {% if active_page == 'other_orders' %} active {% endif %}"> <a href="{% url 'question_steps' 'other_orders' %}" class="progress-question {% if step_status.other_orders == 'Completed' %} complete {% endif %} {% if active_page == 'other_orders' %} active {% endif %}">
<span class="progress-icon"><i class="fa fa-gavel" aria-hidden="true"></i></span> <span class="progress-icon"><i class="fa fa-gavel" aria-hidden="true"></i></span>
<span class="progress-content"><small>Step {% step_order step="other_orders" %}</small><br />Other orders</span> <span class="progress-content"><small>Step {% step_order step="other_orders" %}</small><br />Other orders</span>


+ 0
- 1
edivorce/apps/core/templates/pdf/form52.html View File

@ -2,7 +2,6 @@
{% load composites %} {% load composites %}
{% load input_field %} {% load input_field %}
{% load format_utils %} {% load format_utils %}
{% load load_json %}
<!doctype html> <!doctype html>
<html class="no-js" lang="en"> <html class="no-js" lang="en">


+ 0
- 1
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -3,7 +3,6 @@
{% load format_utils %} {% load format_utils %}
{% load step_order %} {% load step_order %}
{% load format_utils %} {% load format_utils %}
{% load load_json %}
{% block title %}{{ block.super }}: Your Children {% endblock %} {% block title %}{{ block.super }}: Your Children {% endblock %}


+ 6
- 7
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -2,7 +2,6 @@
{% load static %} {% load static %}
{% load input_field %} {% load input_field %}
{% load step_order %} {% load step_order %}
{% load load_json %}
{% load format_utils %} {% load format_utils %}
{% block title %}{{ block.super }}: Your Children {% endblock %} {% block title %}{{ block.super }}: Your Children {% endblock %}
@ -18,7 +17,7 @@
</h3> </h3>
<div class="radio"> <div class="radio">
<label class="radio-with-textbox"> <label class="radio-with-textbox">
{% if 'Child support' in want_which_orders|load_json %}
{% if derived.wants_child_support %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" %} {% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" %}
{% else %} {% else %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" disabled="" %} {% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="MATCH" data_target_id="child_support_in_order_detail" data_reveal_target="false" data_target_class="support-amount-match" data_reveal_class="false" disabled="" %}
@ -44,13 +43,13 @@
</div> </div>
<div class="radio"> <div class="radio">
<label class="radio-with-textbox"> <label class="radio-with-textbox">
{% if 'Child support' in want_which_orders|load_json %}
{% if derived.wants_child_support %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" %} {% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" %}
{% else %} {% else %}
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" disabled="" %} {% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="DIFF" data_target_class="support-amount-match" data_reveal_class="true" data_target_id="child_support_in_order_detail" data_reveal_target="false" disabled="" %}
{% endif %} {% endif %}
{% if 'Child support' in want_which_orders|load_json %}
{% if derived.wants_child_support %}
{% if child_support_in_order == 'DIFF' %} {% if child_support_in_order == 'DIFF' %}
<div class="dollar-prefix"> <div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %} {% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block child-support-amount" data_ajax_only_radio_selected="true" %}
@ -73,8 +72,8 @@
</label> </label>
</div> </div>
<div class="radio"> <div class="radio">
{% if 'Child support' in want_which_orders|load_json %}
{% if derived.wants_child_support %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %} <label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}
We are not asking for child support to be included in the order</label> We are not asking for child support to be included in the order</label>
{% else %} {% else %}
@ -332,7 +331,7 @@
{% endif %} {% endif %}
{# DIV-963: Show/hide logic and text update will be handled by JavaScript function updateChildSupportActQuestion() #} {# DIV-963: Show/hide logic and text update will be handled by JavaScript function updateChildSupportActQuestion() #}
<div class="question-well {% if child_support_act_error %}error{% endif %}" id="child_support_act" {% if 'Child support' in want_which_orders|load_json %}data-want_child_order="true"{% endif %}>
<div class="question-well {% if child_support_act_error %}error{% endif %}" id="child_support_act" {% if derived.wants_child_support %}data-want_child_order="true"{% endif %}>
<h3><span id="child_support_act_question">Please indicate which act(s) you are asking for child support under.</span> <h3><span id="child_support_act_question">Please indicate which act(s) you are asking for child support under.</span>
{% if child_support_act_error %}{% include 'partials/required.html' %}{% endif %} {% if child_support_act_error %}{% include 'partials/required.html' %}{% endif %}
</h3> </h3>


+ 1
- 2
edivorce/apps/core/templates/question/06_children_your_children.html View File

@ -2,7 +2,6 @@
{% load input_field %} {% load input_field %}
{% load format_utils %} {% load format_utils %}
{% load step_order %} {% load step_order %}
{% load load_json %}
{% block title %}{{ block.super }}: Your Children{% endblock %} {% block title %}{{ block.super }}: Your Children{% endblock %}
@ -27,7 +26,7 @@
and <strong>are independent.</strong> and <strong>are independent.</strong>
</p> </p>
{% if 'Child support' not in want_which_orders|load_json %}
{% if derived.wants_child_support %}
<p><strong>Please note: Not asking for child support but have children</strong></p> <p><strong>Please note: Not asking for child support but have children</strong></p>
<p> <p>
Even though you are not asking for an order for child support, you will still need to answer some questions Even though you are not asking for an order for child support, you will still need to answer some questions


+ 0
- 1
edivorce/apps/core/templates/question/12_review.html View File

@ -1,7 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load input_field %} {% load input_field %}
{% load step_order %} {% load step_order %}
{% load load_json %}
{% block title %}{{ block.super }}: Review{% endblock %} {% block title %}{{ block.super }}: Review{% endblock %}


+ 0
- 10
edivorce/apps/core/templatetags/format_utils.py View File

@ -175,16 +175,6 @@ def child_or_children(value):
return '%d children' 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() @register.simple_tag()
def lookup(obj, property): def lookup(obj, property):
""" Return the value of a dynamic property within an object""" """ Return the value of a dynamic property within an object"""


+ 0
- 11
edivorce/apps/core/templatetags/input_field.py View File

@ -134,17 +134,6 @@ def additional_attributes(**kwargs):
return attributes 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 @register.simple_tag
def multiple_values_to_list(source): def multiple_values_to_list(source):
try: try:


+ 0
- 9
edivorce/apps/core/templatetags/load_json.py View File

@ -1,9 +0,0 @@
import json
from django import template
register = template.Library()
@register.filter
def load_json(data):
return json.loads(data)

+ 6
- 2
edivorce/apps/core/templatetags/step_order.py View File

@ -3,8 +3,12 @@ import json
from django.urls import reverse 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() register = template.Library()


+ 1
- 6
edivorce/apps/core/tests/test_efiling_packaging.py View File

@ -1,14 +1,9 @@
import json
from unittest import mock
from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sessions.middleware import SessionMiddleware
from django.core.exceptions import PermissionDenied
from django.test import TransactionTestCase from django.test import TransactionTestCase
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.core.files.uploadedfile import SimpleUploadedFile 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): class EFilingPackagingTests(TransactionTestCase):


+ 1
- 3
edivorce/apps/core/tests/test_efiling_submission.py View File

@ -2,13 +2,11 @@ import json
from unittest import mock from unittest import mock
from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sessions.middleware import SessionMiddleware
from django.core.exceptions import PermissionDenied
from django.test import TransactionTestCase from django.test import TransactionTestCase
from django.test.client import RequestFactory 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_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 = { SAMPLE_TOKEN_RESPONSE = {
"access_token": "klkadlfjadsfkj", "access_token": "klkadlfjadsfkj",


+ 0
- 0
edivorce/apps/poc/__init__.py View File


+ 0
- 22
edivorce/apps/poc/migrations/0001_initial.py View File

@ -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')),
],
),
]

+ 0
- 24
edivorce/apps/poc/migrations/0002_auto_20200823_0606.py View File

@ -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),
),
]

+ 0
- 23
edivorce/apps/poc/migrations/0003_auto_20200915_1645.py View File

@ -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),
),
]

+ 0
- 18
edivorce/apps/poc/migrations/0004_auto_20200917_1008.py View File

@ -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),
),
]

+ 0
- 42
edivorce/apps/poc/migrations/0005_auto_20200921_1255.py View File

@ -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'
)
]

+ 0
- 20
edivorce/apps/poc/migrations/0006_auto_20200921_1301.py View File

@ -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,
),
]

+ 0
- 23
edivorce/apps/poc/migrations/0007_auto_20200921_1523.py View File

@ -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),
),
]

+ 0
- 39
edivorce/apps/poc/migrations/0008_auto_20200922_1027.py View File

@ -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')},
),
]

+ 0
- 18
edivorce/apps/poc/migrations/0009_auto_20200922_1033.py View File

@ -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),
),
]

+ 0
- 16
edivorce/apps/poc/migrations/0010_delete_document.py View File

@ -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',
),
]

+ 0
- 0
edivorce/apps/poc/migrations/__init__.py View File


+ 0
- 46
edivorce/apps/poc/templates/hub.html View File

@ -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 %}
<h1><small>Proof of Concept:</small>Efiling Hub Integration</h1>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="question-well">
<h3>Specify files to upload to the eFiling Hub.</h3>
<div class="form-group {% if form.upload_file.errors %}has-error{% endif %}">
<div>{{ form.upload_file }}</div>
{% if form.upload_file.errors %}
<span class="help-block">
{% for err in form.upload_file.errors %}{{ err }}{% endfor %}
</span>
{% endif %}
</div>
</div>
<div class="form-buttons clearfix">
<button type="submit" class="btn btn-primary pull-right">Submit</button>
</div>
</form>
{% endblock %}
{% block formbuttons %}
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebar %}
<!-- no sidebar -->
{% endblock %}

+ 0
- 19
edivorce/apps/poc/templates/poc-sidebar.html View File

@ -1,19 +0,0 @@
{% load step_order %}
{% load load_json %}
<div class="col-flex progress-column">
<h4>POC</h4>
<a href="{% url 'poc-scan' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-share-alt" aria-hidden="true"></i></span>
<span class="progress-content">File Scanning</span>
</a>
<a href="{% url 'poc-storage' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-info" aria-hidden="true"></i></span>
<span class="progress-content">Redis Storage</span>
</a>
<a href="{% url 'poc-hub' %}" class="progress-question">
<span class="progress-icon"><i class="fa fa-location-arrow" aria-hidden="true"></i></span>
<span class="progress-content">eFiling Hub</span>
</a>
</div>

+ 0
- 27
edivorce/apps/poc/templates/poc/document_confirm_delete.html View File

@ -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 %}
<form method="post">{% csrf_token %}
<p>Are you sure you want to delete "{{ object }}"?</p>
<input type="submit" value="Confirm">
</form>
{% endblock %}
{% block formbuttons %}
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebar %}
<!-- no sidebar -->
{% endblock %}

+ 0
- 47
edivorce/apps/poc/templates/scan.html View File

@ -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 %}
<h1><small>Proof of Concept:</small>File scanning</h1>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="question-well">
<h3>Upload a file to test virus scanning.</h3>
<div class="form-group {% if form.upload_file.errors %}has-error{% elif validation_success %}has-success{% endif %}">
<div>{{ form.upload_file }}</div>
{% if form.upload_file.errors %}
<span class="help-block">
{% for err in form.upload_file.errors %}{{ err }}{% endfor %}
</span>
{% endif %}
{% if validation_success %}<span class="help-block">No viruses found</span>{% endif %}
</div>
</div>
<div class="form-buttons clearfix">
<button type="submit" class="btn btn-primary pull-right">Submit</button>
</div>
</form>
{% endblock %}
{% block formbuttons %}
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebar %}
<!-- no sidebar -->
{% endblock %}

+ 0
- 72
edivorce/apps/poc/templates/storage.html View File

@ -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 %}
<h1><small>Proof of Concept:</small>File storage</h1>
<form id="form" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="question-well">
<h3>Upload a file to store in Redis.</h3>
<div class="form-group {% if form.file.errors %}has-error{% elif validation_success %}has-success{% endif %}">
<div>{{ form.file }}</div>
{% if form.file.errors %}
<span class="help-block">
{% for err in form.file.errors %}{{ err }}{% endfor %}
</span>
{% endif %}
{% if validation_success %}<span class="help-block">No viruses found</span>{% endif %}
</div>
</div>
<div class="form-buttons clearfix">
<button type="submit" class="btn btn-primary pull-right">Submit</button>
</div>
<div class="question-well">
<h3>Stored documents</h3>
<table class="table">
<thead>
<tr>
<th>File name</th>
<th>Redis key</th>
<th></th>
</tr>
</thead>
<tbody>
{% for document in documents %}
<tr>
<td class="fact-sheet-question">
<a href="{% url "poc-storage-download" document.id %}" target="_blank">
{{ document.filename|default:'' }}
</a>
</td>
<td class="fact-sheet-question">{{ document.file.name }}</td>
<td><a href="{% url "poc-storage-delete" document.id %}" class="delete-link">Delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</form>
{% endblock %}
{% block formbuttons %}
{% endblock %}
{% block sidebarNav %}
<!-- no sidebar -->
{% endblock %}
{% block sidebar %}
<!-- no sidebar -->
{% endblock %}

+ 0
- 12
edivorce/apps/poc/urls.py View File

@ -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<document_id>\d+)', login_required(views.view_document_file), name="poc-storage-download"),
url(r'storage/delete/(?P<pk>\d+)', login_required(views.UploadStorageDelete.as_view()), name="poc-storage-delete"),
url(r'storage', login_required(views.UploadStorage.as_view()), name="poc-storage"),
]

+ 0
- 112
edivorce/apps/poc/views.py View File

@ -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)

+ 0
- 5
edivorce/settings/base.py View File

@ -58,11 +58,6 @@ INSTALLED_APPS = (
'graphene_django', 'graphene_django',
) )
# add the POC app only if applicable
if ENVIRONMENT in ['localdev', 'dev', 'test']:
INSTALLED_APPS += (
'edivorce.apps.poc',
)
MIDDLEWARE = ( MIDDLEWARE = (
'edivorce.apps.core.middleware.basicauth_middleware.BasicAuthMiddleware', 'edivorce.apps.core.middleware.basicauth_middleware.BasicAuthMiddleware',


+ 0
- 1
edivorce/urls.py View File

@ -12,7 +12,6 @@ urlpatterns = []
if settings.ENVIRONMENT in ['localdev', 'dev', 'test']: if settings.ENVIRONMENT in ['localdev', 'dev', 'test']:
import debug_toolbar import debug_toolbar
urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)),) 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')) urlpatterns.append(path('api/graphql/', csrf_exempt(PrivateGraphQLView.as_view(graphiql=True, schema=graphql_schema)), name='graphql'))
else: else:
urlpatterns.append(path('api/graphql/', csrf_exempt(PrivateGraphQLView.as_view(graphiql=False, schema=graphql_schema)), name='graphql')) urlpatterns.append(path('api/graphql/', csrf_exempt(PrivateGraphQLView.as_view(graphiql=False, schema=graphql_schema)), name='graphql'))


Loading…
Cancel
Save