Check for attr rather than classname
This commit is contained in:
parent
c48c830483
commit
35ef339f8f
@ -1,8 +1,6 @@
|
||||
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):
|
||||
@ -48,10 +46,7 @@ def mixedContentToJson(value):
|
||||
if (
|
||||
isinstance(value, dict)
|
||||
and "task_order" in value
|
||||
and (
|
||||
isinstance(value["task_order"]["pdf"], FileStorage)
|
||||
or isinstance(value["task_order"]["pdf"], Attachment)
|
||||
)
|
||||
and hasattr(value["task_order"]["pdf"], "filename")
|
||||
):
|
||||
value["task_order"]["pdf"] = value["task_order"]["pdf"].filename
|
||||
return app.jinja_env.filters["tojson"](value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user