Remove custom JSON filter

This commit is contained in:
Patrick Smith 2019-01-23 10:31:35 -05:00
parent 849238f218
commit b3270a46cf
3 changed files with 2 additions and 16 deletions

View File

@ -49,19 +49,6 @@ def getOptionLabel(value, options):
return
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):
for k, v in value.items():
if hasattr(v, "filename"):
value[k] = v.filename
return app.jinja_env.filters["tojson"](value)
def findFilter(value, filter_name, filter_args=[]):
if not filter_name:
return value
@ -124,7 +111,6 @@ 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["mixedContentToJson"] = mixedContentToJson
app.jinja_env.filters["findFilter"] = findFilter
app.jinja_env.filters["renderList"] = renderList
app.jinja_env.filters["formattedDate"] = formattedDate

View File

@ -21,7 +21,7 @@
{{ Alert(("requests.financial_verification.pending_financial_verification" | translate), fragment="fragments/pending_financial_verification.html") }}
{% endif %}
<financial inline-template v-bind:initial-data='{{ f.data|mixedContentToJson }}'>
<financial inline-template v-bind:initial-data='{{ f.data|tojson }}'>
<div class="col">
{% if extended %}
{{ Alert(("requests.financial_verification.manually_enter_task_information_label" | translate),

View File

@ -14,7 +14,7 @@
<funding
inline-template
v-bind:initial-data='{{ form.data|mixedContentToJson }}'
v-bind:initial-data='{{ form.data|tojson }}'
v-bind:upload-errors='{{ form.csp_estimate.errors | list }}'
>
<div>