Skip to content

Commit

Permalink
Merge pull request #264 from Dewberry/bugfix/html-rendering
Browse files Browse the repository at this point in the history
Bugfix/html rendering
  • Loading branch information
slawler authored Dec 20, 2024
2 parents 20bc400 + c1bf034 commit f93bb30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
exclude production/*
include ripple1d\api\templates\*
recursive-include ripple1d\api\static\ *
13 changes: 7 additions & 6 deletions ripple1d/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ def test():
@app.route("/jobs", methods=["GET"])
def jobs():
"""Retrieve OGC status and result for all jobs."""
# try:
format_option = request.args.get("f")
format_option = request.args.get("f", default="json")
task2metadata = tasks.task_status(only_task_id=None)
jobs = [get_job_status(task_id, huey_metadata) for task_id, huey_metadata in task2metadata.items()]
response = {"jobs": jobs}
Expand Down Expand Up @@ -273,7 +272,9 @@ def parse_request_param__bool(param_name: str, default: bool) -> tuple[bool, tup
)


def get_job_status(task_id: str, huey_metadata: dict, return_result: bool = False, include_traceback: bool = False) -> dict:
def get_job_status(
task_id: str, huey_metadata: dict, return_result: bool = False, include_traceback: bool = False
) -> dict:
"""Convert huey-style task status metadata into a OGC-style job summary dictionary."""
out_dict = {
"jobID": task_id,
Expand All @@ -282,9 +283,9 @@ def get_job_status(task_id: str, huey_metadata: dict, return_result: bool = Fals
"processID": huey_metadata["func_name"],
}
if return_result:
if not include_traceback and huey_metadata['result'] is not None:
del huey_metadata['result']['tb']
out_dict["result"] = huey_metadata['result']
if not include_traceback and huey_metadata["result"] is not None:
del huey_metadata["result"]["tb"]
out_dict["result"] = huey_metadata["result"]
return out_dict


Expand Down

0 comments on commit f93bb30

Please sign in to comment.