Fix json serialization bug in finver form
This commit is contained in:
@@ -2,6 +2,7 @@ import re
|
||||
import datetime
|
||||
from flask import current_app as app
|
||||
from werkzeug.datastructures import FileStorage
|
||||
from atst.models.attachment import Attachment
|
||||
|
||||
|
||||
def iconSvg(name):
|
||||
@@ -47,9 +48,12 @@ def mixedContentToJson(value):
|
||||
if (
|
||||
isinstance(value, dict)
|
||||
and "task_order" in value
|
||||
and isinstance(value["task_order"], FileStorage)
|
||||
and (
|
||||
isinstance(value["task_order"]["pdf"], FileStorage)
|
||||
or isinstance(value["task_order"]["pdf"], Attachment)
|
||||
)
|
||||
):
|
||||
value["task_order"] = value["task_order"].filename
|
||||
value["task_order"]["pdf"] = value["task_order"]["pdf"].filename
|
||||
return app.jinja_env.filters["tojson"](value)
|
||||
|
||||
|
||||
|
@@ -244,3 +244,4 @@ class FinancialVerificationForm(ValidatedForm):
|
||||
@property
|
||||
def is_only_missing_task_order_number(self):
|
||||
return "task_order_number" in self.errors and len(self.errors) == 1
|
||||
|
||||
|
Reference in New Issue
Block a user