Skip to content
Snippets Groups Projects
Commit 6922765b authored by Jim Sheckard's avatar Jim Sheckard
Browse files

uniform_weblog_digging: Strings where strings are wanted, and the extended...

parent be0594df
No related branches found
No related tags found
3 merge requests!1059Catchup 2.7 with main,!1058Draft: Rebase 2.7 on main,!1025uniform_weblog_digging: Strings where strings are wanted, and the extended...
Pipeline #6319 passed
......@@ -182,7 +182,7 @@ class WorkflowWorkingDirRestService:
},
)
redirect_url = self.generate_url_from_path(index_path, results_path)
redirect_url = self.generate_url_from_path(str(index_path), str(results_path))
return Response(status_int=http.HTTPStatus.FOUND, location=redirect_url)
@view_config(request_method="GET", route_name="get_qa_notes", renderer="json")
......@@ -202,7 +202,7 @@ class WorkflowWorkingDirRestService:
)
qa_notes_text = ""
with open(qa_notes_path, "r") as qa_notes:
with open(str(qa_notes_path), "r") as qa_notes:
qa_notes_text = qa_notes.read()
return Response(status_int=http.HTTPStatus.OK, json_body={"resp": f"{qa_notes_text}"})
......@@ -223,7 +223,7 @@ class WorkflowWorkingDirRestService:
},
)
with open(qa_notes_path, "w") as qa_notes:
with open(str(qa_notes_path), "w") as qa_notes:
# sanitize input before writing/persisting
# \\u0000 is an invalid character that is incompatible with postgres json columns
# from StackOverflow: https://stackoverflow.com/questions/63092267/how-to-handle-api-responsesjson-containing-x00-or-u0000-in-its-data-and-s
......@@ -309,11 +309,11 @@ class WorkflowWorkingDirRestService:
def generate_url_from_path(self, root_path, results_path):
current_url = self.request.current_route_url()
return current_url.replace("/weblog", "/dir") + root_path.replace(results_path, "") + "/html/index.html"
return current_url.replace("/weblog", "/dir") + root_path.replace(results_path, "")
def generate_qa_notes_path(self, root_path, results_path):
current_url = self.request.current_route_url()
return current_url.replace("/qa_notes", "/dir") + root_path.replace(results_path, "") + "/html/qa_notes.html"
return current_url.replace("/qa_notes", "/dir") + root_path.replace(results_path, "")
@view_defaults(route_name="workflow_request", renderer="json")
......
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