Browse Source

Updates to error handling from the efiling hub

pull/172/head
Michael Olund 5 years ago
parent
commit
cfc0af04c5
2 changed files with 6 additions and 4 deletions
  1. +1
    -1
      edivorce/apps/core/templates/dashboard/final_filing.html
  2. +5
    -3
      edivorce/apps/core/utils/efiling_submission.py

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

@ -58,7 +58,7 @@
<div class="review-warning" id="error-message-box" {% if not messages %}hidden{% endif %}> <div class="review-warning" id="error-message-box" {% if not messages %}hidden{% endif %}>
<ul id="error-messages" class="{% if messages|length == 1 %}no-bullets no-padding-left {% endif %}no-margin-bottom"> <ul id="error-messages" class="{% if messages|length == 1 %}no-bullets no-padding-left {% endif %}no-margin-bottom">
{% for message in messages %} {% for message in messages %}
<li>{{ message }}</li>
<li>{{ message|safe }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>


+ 5
- 3
edivorce/apps/core/utils/efiling_submission.py View File

@ -171,9 +171,11 @@ class EFilingSubmission:
response = json.loads(response.text) response = json.loads(response.text)
if 'details' in response and len(response['details']) > 0: if 'details' in response and len(response['details']) > 0:
message = f"<p>{response['message']}</p>"
details = f"<ul><li>{'</li><li>'.join(response['details'])}</li></ul>"
return None, message + details
details = ' '.join(response['details'])
# clean up the message to make it presentable
details = details.replace('[', '').replace(']', '').replace(
'FileNumber', 'File number')
return None, details
return None, f"{response['error']} - {response['message']}" return None, f"{response['error']} - {response['message']}"


Loading…
Cancel
Save