From 7a4390b011e120c960722bf4ef0a7d9c6394d8c4 Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 6 Jan 2023 15:55:51 -0500 Subject: [PATCH] pyl w/ burnettk --- .../routes/process_models_controller.py | 7 +++++++ .../services/process_instance_report_service.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py index 1709357a7..b0030c042 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py @@ -31,6 +31,9 @@ from spiffworkflow_backend.routes.process_api_blueprint import ( ) from spiffworkflow_backend.services.git_service import GitService from spiffworkflow_backend.services.git_service import MissingGitConfigsError +from spiffworkflow_backend.services.process_instance_report_service import ( + ProcessInstanceReportNotFoundError, +) from spiffworkflow_backend.services.process_instance_report_service import ( ProcessInstanceReportService, ) @@ -437,6 +440,10 @@ def process_model_create_with_natural_language( default_report_metadata = ProcessInstanceReportService.system_metadata_map( "default" ) + if default_report_metadata is None: + raise ProcessInstanceReportNotFoundError( + "Could not find a report with identifier 'default'" + ) for column in columns: default_report_metadata["columns"].append( {"Header": column, "accessor": column, "filterable": True} diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py index 47156d3fb..8d37b859f 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py @@ -48,7 +48,7 @@ class ProcessInstanceReportFilter: with_tasks_completed_by_me: Optional[bool] = None with_tasks_assigned_to_my_group: Optional[bool] = None with_relation_to_me: Optional[bool] = None - process_initiator_username: Optional[str] = (None,) + process_initiator_username: Optional[str] = None def to_dict(self) -> dict[str, str]: """To_dict."""