rename JSON filter for PDF file upload

This commit is contained in:
dandds 2018-08-28 11:22:16 -04:00
parent 10b1a6955a
commit 2bfdf33ac3
2 changed files with 7 additions and 3 deletions

View File

@ -33,7 +33,11 @@ def getOptionLabel(value, options):
return next(tup[1] for tup in options if tup[0] == value)
def enhancedToJson(value):
def mixedContentToJson(value):
"""
This coerces the file upload in form data to its filename
so that the data can be JSON serialized.
"""
if (
isinstance(value, dict)
and "task_order" in value
@ -49,4 +53,4 @@ def register_filters(app):
app.jinja_env.filters["usPhone"] = usPhone
app.jinja_env.filters["readableInteger"] = readableInteger
app.jinja_env.filters["getOptionLabel"] = getOptionLabel
app.jinja_env.filters["enhancedToJson"] = enhancedToJson
app.jinja_env.filters["mixedContentToJson"] = mixedContentToJson

View File

@ -6,7 +6,7 @@
{% block content %}
<financial inline-template v-bind:initial-data='{{ f.data|enhancedToJson }}'>
<financial inline-template v-bind:initial-data='{{ f.data|mixedContentToJson }}'>
<div class="col">
{% if extended %}