Browse Source

Merge branch 'master' into DIV-1023

# Conflicts:
#	edivorce/apps/core/utils/cso_filing.py
pull/172/head
ariannedee 5 years ago
parent
commit
8ca8e303a0
6 changed files with 117 additions and 30 deletions
  1. +75
    -25
      edivorce/apps/core/efilinghub.py
  2. +1
    -1
      edivorce/apps/core/management/commands/link_check.py
  3. +1
    -1
      edivorce/apps/core/templates/legal.html
  4. +2
    -0
      edivorce/apps/core/urls.py
  5. +11
    -2
      edivorce/apps/core/utils/cso_filing.py
  6. +27
    -1
      edivorce/apps/core/views/efiling.py

+ 75
- 25
edivorce/apps/core/efilinghub.py View File

@ -97,7 +97,8 @@ NJF_JSON_FORMAT = {
}, },
"dateOfMarriage": "", "dateOfMarriage": "",
"reasonForDivorce": "S", "reasonForDivorce": "S",
"act": "",
"childSupportAct": [],
"spouseSupportAct": "",
"ordersSought": [] "ordersSought": []
} }
@ -229,16 +230,18 @@ class EFilingHub:
if parties: if parties:
package['filingPackage']['parties'] = parties package['filingPackage']['parties'] = parties
# update return urls # update return urls
package['navigationUrls']['success'] = request.build_absolute_uri(
reverse('dashboard_nav', args=['check_with_registry']))
package['navigationUrls']['error'] = request.build_absolute_uri( package['navigationUrls']['error'] = request.build_absolute_uri(
reverse('dashboard_nav', args=['check_with_registry'])) reverse('dashboard_nav', args=['check_with_registry']))
if self.initial_filing: if self.initial_filing:
package['navigationUrls']['cancel'] = request.build_absolute_uri( package['navigationUrls']['cancel'] = request.build_absolute_uri(
reverse('dashboard_nav', args=['initial_filing'])) reverse('dashboard_nav', args=['initial_filing']))
package['navigationUrls']['success'] = request.build_absolute_uri(
reverse('after_submit_initial_files'))
else: else:
package['navigationUrls']['cancel'] = request.build_absolute_uri( package['navigationUrls']['cancel'] = request.build_absolute_uri(
reverse('dashboard_nav', args=['final_filing'])) reverse('dashboard_nav', args=['final_filing']))
package['navigationUrls']['success'] = request.build_absolute_uri(
reverse('after_submit_final_files'))
return package return package
@ -267,6 +270,19 @@ class EFilingHub:
except: except:
return '' return ''
def get_aliases(str):
aliases = []
names = json.loads(str)
for name in names:
if len(name) == 5 and name[1] != '' and name[2] != '':
alias = NJF_ALIAS_FORMAT.copy()
alias["surname"] = name[1]
alias["given1"] = name[2]
alias["given2"] = name[3]
alias["given3"] = name[4]
aliases.append(alias)
return aliases
r = responses r = responses
d = NJF_JSON_FORMAT.copy() d = NJF_JSON_FORMAT.copy()
@ -281,36 +297,70 @@ class EFilingHub:
signing_location_spouse = r.get('signing_location_spouse') signing_location_spouse = r.get('signing_location_spouse')
party1 = d["parties"][0] party1 = d["parties"][0]
party1["surname"] = r.get('last_name_you', '').strip()
party1["given1"] = r.get('given_name_1_you', '').strip()
party1["given2"] = r.get('given_name_2_you', '').strip()
party1["given3"] = r.get('given_name_3_you', '').strip()
party1["surname"] = r.get('last_name_you', '')
party1["given1"] = r.get('given_name_1_you', '')
party1["given2"] = r.get('given_name_2_you', '')
party1["given3"] = r.get('given_name_3_you', '')
party1["birthDate"] = format_date(r.get('birthday_you')) party1["birthDate"] = format_date(r.get('birthday_you'))
party1["surnameAtBirth"] = r.get('last_name_born_you', '').strip()
party1["surnameBeforeMarriage"] = r.get('last_name_before_married_you', '').strip()
email = r.get('email_you', '').strip()
party1["surnameAtBirth"] = r.get('last_name_born_you', '')
party1["surnameBeforeMarriage"] = r.get('last_name_before_married_you', '')
email = r.get('email_you', '')
if not email: if not email:
email = r.get('address_to_send_official_document_email_you', '').strip()
email = r.get('address_to_send_official_document_email_you', '')
party1["email"] = email party1["email"] = email
party1["signingVirtually"] = signing_location_you == 'Virtual' party1["signingVirtually"] = signing_location_you == 'Virtual'
party1["aliases"] = []
if r.get('any_other_name_you') == 'YES':
party1["aliases"] = get_aliases(r.get('other_name_you'))
party2 = d["parties"][1] party2 = d["parties"][1]
party2["surname"] = r.get('last_name_spouse', '').strip()
party2["given1"] = r.get('given_name_1_spouse', '').strip()
party2["given2"] = r.get('given_name_2_spouse', '').strip()
party2["given3"] = r.get('given_name_3_spouse', '').strip()
party2["surname"] = r.get('last_name_spouse', '')
party2["given1"] = r.get('given_name_1_spouse', '')
party2["given2"] = r.get('given_name_2_spouse', '')
party2["given3"] = r.get('given_name_3_spouse', '')
party2["birthDate"] = format_date(r.get('birthday_spouse')) party2["birthDate"] = format_date(r.get('birthday_spouse'))
party2["surnameAtBirth"] = r.get('last_name_born_spouse', '').strip()
party2["surnameBeforeMarriage"] = r.get('last_name_before_married_spouse', '').strip()
email = r.get('email_spouse', '').strip()
party2["surnameAtBirth"] = r.get('last_name_born_spouse', '')
party2["surnameBeforeMarriage"] = r.get('last_name_before_married_spouse', '')
email = r.get('email_spouse', '')
if not email: if not email:
email = r.get('address_to_send_official_document_email_spouse', '').strip()
email = r.get('address_to_send_official_document_email_spouse', '')
party2["email"] = email party2["email"] = email
party2["signingVirtually"] = signing_location_spouse == 'Virtual' party2["signingVirtually"] = signing_location_spouse == 'Virtual'
party2["aliases"] = []
if r.get('any_other_name_spouse') == 'YES':
party2["aliases"] = get_aliases(r.get('other_name_spouse'))
d["dateOfMarriage"] = format_date(r.get('when_were_you_married')) d["dateOfMarriage"] = format_date(r.get('when_were_you_married'))
d["placeOfMarriage"]["country"] = r.get('where_were_you_married_country', '')
d["placeOfMarriage"]["province"] = r.get('where_were_you_married_prov', '')
d["placeOfMarriage"]["city"] = r.get('where_were_you_married_city', '')
d["childSupportAct"] = json.loads(r.get('child_support_act', '[]'))
d["spouseSupportAct"] = r.get('spouse_support_act', '')
orders_sought = json.loads(r.get('want_which_orders', '[]'))
if 'A legal end to the marriage' in orders_sought:
d["ordersSought"].append('DIV')
if 'Spousal support' in orders_sought:
d["ordersSought"].append('SSU')
if 'Division of property and debts' in orders_sought:
division = r.get('deal_with_property_debt', '')
if division == 'Equal division':
d["ordersSought"].append('DFA')
if division == 'Unequal division':
d["ordersSought"].append('RFA')
if re.sub(r'\W+', '', r.get('other_property_claims', '')) != '':
d["ordersSought"].append('PRO')
if 'Child support' in orders_sought:
d["ordersSought"].append('CSU')
if 'Other orders' in orders_sought:
if r.get('name_change_you') == 'YES' or r.get('name_change_spouse') == 'YES':
d["ordersSought"].append('NAM')
if re.sub(r'\W+', '', r.get('other_orders_detail ', '')) != '':
d["ordersSought"].append('OTH')
return d return d
@ -348,19 +398,19 @@ class EFilingHub:
parties = [] parties = []
party1 = PACKAGE_PARTY_FORMAT.copy() party1 = PACKAGE_PARTY_FORMAT.copy()
party1['firstName'] = responses.get('given_name_1_you', '').strip()
party1['firstName'] = responses.get('given_name_1_you', '')
party1['middleName'] = (responses.get('given_name_2_you', '') + party1['middleName'] = (responses.get('given_name_2_you', '') +
' ' + ' ' +
responses.get('given_name_3_you', '')).strip() responses.get('given_name_3_you', '')).strip()
party1['lastName'] = responses.get('last_name_you', '').strip()
party1['lastName'] = responses.get('last_name_you', '')
parties.append(party1) parties.append(party1)
party2 = PACKAGE_PARTY_FORMAT.copy() party2 = PACKAGE_PARTY_FORMAT.copy()
party2['firstName'] = responses.get('given_name_1_spouse', '').strip()
party2['firstName'] = responses.get('given_name_1_spouse', '')
party2['middleName'] = (responses.get('given_name_2_spouse', '') + party2['middleName'] = (responses.get('given_name_2_spouse', '') +
' ' + ' ' +
responses.get('given_name_3_spouse', '')).strip() responses.get('given_name_3_spouse', '')).strip()
party2['lastName'] = responses.get('last_name_spouse', '').strip()
party2['lastName'] = responses.get('last_name_spouse', '')
parties.append(party2) parties.append(party2)
return parties return parties


+ 1
- 1
edivorce/apps/core/management/commands/link_check.py View File

@ -35,7 +35,7 @@ class Command(BaseCommand):
if link is None: if link is None:
continue continue
if link['href'].startswith('http'): if link['href'].startswith('http'):
filename = str(file_path.name)
filename = str(fs.name)
status = self._check_link(link['href']) status = self._check_link(link['href'])
if status: if status:


+ 1
- 1
edivorce/apps/core/templates/legal.html View File

@ -67,7 +67,7 @@
</p> </p>
<p> <p>
If you think you will want legal help for only part of your separation or divorce, you can look for a lawyer that If you think you will want legal help for only part of your separation or divorce, you can look for a lawyer that
offers “unbundled” services. The
offers &ldquo;unbundled&rdquo; services. The
<a href="https://sites.google.com/view/bfur/" target="_blank">BC Family Law Unbundling Roster (HelpMap)</a> <a href="https://sites.google.com/view/bfur/" target="_blank">BC Family Law Unbundling Roster (HelpMap)</a>
is a list of legal professionals near you who offer unbundled services. Many also offer their services remotely, is a list of legal professionals near you who offer unbundled services. Many also offer their services remotely,
through telephone, webconferencing or other tools. through telephone, webconferencing or other tools.


+ 2
- 0
edivorce/apps/core/urls.py View File

@ -23,6 +23,8 @@ urlpatterns = [
url(r'^dashboard/(?P<nav_step>.*)', main.dashboard_nav, name="dashboard_nav"), url(r'^dashboard/(?P<nav_step>.*)', main.dashboard_nav, name="dashboard_nav"),
path('submit/initial', efiling.submit_initial_files, name="submit_initial_files"), path('submit/initial', efiling.submit_initial_files, name="submit_initial_files"),
path('submit/final', efiling.submit_final_files, name="submit_final_files"), path('submit/final', efiling.submit_final_files, name="submit_final_files"),
path('after-submit/initial', efiling.after_submit_initial_files, name="after_submit_initial_files"),
path('after-submit/final', efiling.after_submit_final_files, name="after_submit_final_files"),
url(r'^health$', system.health), url(r'^health$', system.health),
url(r'^legal$', main.legal, name="legal"), url(r'^legal$', main.legal, name="legal"),
url(r'^acknowledgements$', main.acknowledgements, name="acknowledgements"), url(r'^acknowledgements$', main.acknowledgements, name="acknowledgements"),


+ 11
- 2
edivorce/apps/core/utils/cso_filing.py View File

@ -20,7 +20,8 @@ def file_documents(request, responses, initial=False):
uploaded, generated = forms_to_file(responses, initial) uploaded, generated = forms_to_file(responses, initial)
for form in uploaded: for form in uploaded:
docs = Document.objects.filter(bceid_user=user, doc_type=form['doc_type'], party_code=form.get('party_code', 0))
docs = Document.objects.filter(
bceid_user=user, doc_type=form['doc_type'], party_code=form.get('party_code', 0))
if docs.count() == 0: if docs.count() == 0:
errors.append(f"Missing documents for {Document.form_types[form['doc_type']]}") errors.append(f"Missing documents for {Document.form_types[form['doc_type']]}")
@ -34,12 +35,20 @@ def file_documents(request, responses, initial=False):
location = hub.get_location(responses) location = hub.get_location(responses)
parties = hub.get_parties(responses) parties = hub.get_parties(responses)
redirect_url, msg = hub.upload(request, post_files, documents, parties, location) redirect_url, msg = hub.upload(request, post_files, documents, parties, location)
if redirect_url: if redirect_url:
return errors, redirect_url return errors, redirect_url
if msg:
return msg, None
return None, None
def after_file_documents(request, initial=False):
user = request.user
# Save dummy data for now. Eventually replace with data from CSO # Save dummy data for now. Eventually replace with data from CSO
prefix = 'initial' if initial else 'final' prefix = 'initial' if initial else 'final'
_save_response(user, f'{prefix}_filing_submitted', True) _save_response(user, f'{prefix}_filing_submitted', True)


+ 27
- 1
edivorce/apps/core/views/efiling.py View File

@ -4,7 +4,7 @@ from django.urls import reverse
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from ..decorators import prequal_completed from ..decorators import prequal_completed
from ..utils.cso_filing import file_documents
from ..utils.cso_filing import file_documents, after_file_documents
from ..utils.user_response import get_data_for_user from ..utils.user_response import get_data_for_user
@ -43,3 +43,29 @@ def _submit_files(request, initial=False):
responses_dict['active_page'] = next_page responses_dict['active_page'] = next_page
return redirect(reverse('dashboard_nav', kwargs={'nav_step': next_page}), context=responses_dict) return redirect(reverse('dashboard_nav', kwargs={'nav_step': next_page}), context=responses_dict)
@login_required
@prequal_completed
def after_submit_initial_files(request):
return _after_submit_files(request, initial=True)
@login_required
@prequal_completed
def after_submit_final_files(request):
return _after_submit_files(request, initial=False)
def _after_submit_files(request, initial=False):
responses_dict = get_data_for_user(request.user)
if initial:
next_page = 'wait_for_number'
else:
next_page = 'next_steps'
after_file_documents(request, initial=initial)
responses_dict['active_page'] = next_page
return redirect(reverse('dashboard_nav', kwargs={'nav_step': next_page}), context=responses_dict)

Loading…
Cancel
Save