Skip to content
Snippets Groups Projects
Commit 07330cf5 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Preventing an exception from wiping the qa_notes.html file

parent 26f3e27a
No related branches found
No related tags found
3 merge requests!1571catch 2.8.2.3 up with main,!15462.8.2.1 patch development to main,!1542WS-2156 Preventing an exception from wiping the qa_notes.html file
Pipeline #13190 passed
......@@ -231,6 +231,15 @@ class WorkflowWorkingDirRestService:
},
)
# If an exception is thrown with the qa_notes file open, its contents will be wiped
if "edits" not in self.request.json_body:
return Response(
status_int=http.HTTPStatus.OK,
json_body={
"resp": f"No edits were made to QA notes file in workflow {self.request.matchdict['request_id']}."
},
)
with open(qa_notes_path, "w") as qa_notes:
# sanitize input before writing/persisting
# \\u0000 is an invalid character that is incompatible with postgres json columns
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment