Fixing a regression. It's critical that Spiffworkflow's box implement deepcopy, as this is used by Jinga prior to generating a word document.

This commit is contained in:
Dan 2021-05-05 21:36:57 -04:00
parent 5a79b80f32
commit 620b9a5188
2 changed files with 8 additions and 5 deletions

8
Pipfile.lock generated
View File

@ -885,10 +885,10 @@
},
"six": {
"hashes": [
"sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259",
"sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
"sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
],
"version": "==1.15.0"
"version": "==1.16.0"
},
"snowballstemmer": {
"hashes": [
@ -957,7 +957,7 @@
},
"spiffworkflow": {
"git": "https://github.com/sartography/SpiffWorkflow.git",
"ref": "54a3cda7c40b7ee35e0b21ede92606d1097279dd"
"ref": "1a44d004d657bc5773551254aafba88993ae6d35"
},
"sqlalchemy": {
"hashes": [

View File

@ -114,7 +114,10 @@ Takes two arguments:
doc_context = self.rich_text_update(doc_context)
doc_context = self.append_images(doc, doc_context, image_file_data)
jinja_env = jinja2.Environment(autoescape=True)
doc.render(doc_context, jinja_env)
try:
doc.render(doc_context, jinja_env)
except Exception as e:
print (e)
target_stream = BytesIO()
doc.save(target_stream)
target_stream.seek(0) # move to the beginning of the stream.