Check for attr rather than classname
This commit is contained in:
parent
c48c830483
commit
35ef339f8f
@ -1,8 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
import datetime
|
import datetime
|
||||||
from flask import current_app as app
|
from flask import current_app as app
|
||||||
from werkzeug.datastructures import FileStorage
|
|
||||||
from atst.models.attachment import Attachment
|
|
||||||
|
|
||||||
|
|
||||||
def iconSvg(name):
|
def iconSvg(name):
|
||||||
@ -48,10 +46,7 @@ def mixedContentToJson(value):
|
|||||||
if (
|
if (
|
||||||
isinstance(value, dict)
|
isinstance(value, dict)
|
||||||
and "task_order" in value
|
and "task_order" in value
|
||||||
and (
|
and hasattr(value["task_order"]["pdf"], "filename")
|
||||||
isinstance(value["task_order"]["pdf"], FileStorage)
|
|
||||||
or isinstance(value["task_order"]["pdf"], Attachment)
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
value["task_order"]["pdf"] = value["task_order"]["pdf"].filename
|
value["task_order"]["pdf"] = value["task_order"]["pdf"].filename
|
||||||
return app.jinja_env.filters["tojson"](value)
|
return app.jinja_env.filters["tojson"](value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user