Browse Source

Merge pull request #146 from gerritvdm/Feature/DIV-1101

Feature/div 1101
pull/172/head
Michael Olund 5 years ago
committed by GitHub
parent
commit
c5dcdcecc0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions
  1. +2
    -2
      edivorce/apps/core/efilinghub.py
  2. +1
    -1
      edivorce/apps/core/management/commands/link_check.py
  3. +3
    -2
      edivorce/apps/core/templatetags/format_utils.py
  4. +2
    -2
      edivorce/apps/core/templatetags/summary_format.py

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

@ -384,7 +384,7 @@ class EFilingHub:
if doc_type == 'NJF':
document['data'] = self._get_json_data(responses)
pdf_response = pdf_form(request, str(form['form_number']))
document['md5'] = hashlib.md5(pdf_response.content).hexdigest()
document['md5'] = hashlib.md5(pdf_response.content).hexdigest() # nosec
post_files.append(('files', (document['name'], pdf_response.content)))
documents.append(document)
@ -394,7 +394,7 @@ class EFilingHub:
pdf_response = images_to_pdf(request, doc_type, party_code)
if pdf_response.status_code == 200:
document = self._get_document(doc_type, party_code)
document['md5'] = hashlib.md5(pdf_response.content).hexdigest()
document['md5'] = hashlib.md5(pdf_response.content).hexdigest() # nosec
post_files.append(('files', (document['name'], pdf_response.content)))
documents.append(document)


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

@ -13,7 +13,7 @@ class Command(BaseCommand):
def _check_link(self, address):
try:
resp = urlopen(address)
resp = urlopen(address) # nosec - This is for internal use only to check for broken links.
if resp.status in [400, 404, 403, 408, 409, 501, 502, 503]:
return f"{resp.status} - {resp.reason}"
except Exception as e:


+ 3
- 2
edivorce/apps/core/templatetags/format_utils.py View File

@ -21,7 +21,7 @@ def linebreaksli(value):
value = re.sub(r'\r\n|\r|\n', '\n', value.strip()) # normalize newlines
lines = re.split('\n', value)
lines = ['<li>%s</li>' % line for line in lines if line and not line.isspace()]
return mark_safe('\n'.join(lines))
return mark_safe('\n'.join(lines)) # nosec
@register.filter
@ -92,7 +92,8 @@ def checkbox(context, *args, **kwargs):
kwargs_list.append(str(value) in str(dict_with_question[question]))
kwargs_pass = all(kwargs_list)
return mark_safe('<i class="fa fa%s-square-o" aria-hidden="true"></i>' %
return mark_safe('<i class="fa fa%s-square-o" aria-hidden="true"></i>' % # nosec
('-check' if args_pass and kwargs_pass else ''))


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

@ -8,7 +8,7 @@ from django.utils.html import format_html, format_html_join
from django.utils.safestring import mark_safe
NO_ANSWER = 'No answer'
MISSING_RESPONSE = mark_safe('<div class="table-error"><span class="warning">MISSING REQUIRED FIELD</span></div>')
MISSING_RESPONSE = mark_safe('<div class="table-error"><span class="warning">MISSING REQUIRED FIELD</span></div>') # nosec
register = template.Library()
@ -151,7 +151,7 @@ def format_review_row_heading(title, style="", substep=None):
""" Used for children sub-section tables """
if substep:
url = reverse('question_steps', args=['children', substep])
extra_html = mark_safe(f'<span class="review-buttons"><a href="{url}">Edit</a></span>')
extra_html = mark_safe(f'<span class="review-buttons"><a href="{url}">Edit</a></span>') # nosec
else:
extra_html = ''
return format_html(


Loading…
Cancel
Save