From 2bfdf33ac37090ea23f1c4c0f24a417e444c2500 Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 28 Aug 2018 11:22:16 -0400 Subject: [PATCH] rename JSON filter for PDF file upload --- atst/filters.py | 8 ++++++-- templates/requests/financial_verification.html | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/atst/filters.py b/atst/filters.py index c56cb739..6811d198 100644 --- a/atst/filters.py +++ b/atst/filters.py @@ -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 diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index 88a9272b..51eeccba 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -6,7 +6,7 @@ {% block content %} - +
{% if extended %}