From 859fe5793ed26faaed3a1cac748d06045c4227fe Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Fri, 18 Nov 2022 14:34:52 -0500 Subject: [PATCH] Get ./bin/pyl to pass --- .../routes/process_api_blueprint.py | 6 ++++-- .../services/process_instance_report_service.py | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index dd4037e7..307daa8c 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -736,10 +736,12 @@ def process_instance_list( end_to: Optional[int] = None, process_status: Optional[str] = None, user_filter: Optional[bool] = False, - report_identifier: Optional[str] = None + report_identifier: Optional[str] = None, ) -> flask.wrappers.Response: """Process_instance_list.""" - process_instance_report = ProcessInstanceReportService.report_with_identifier(g.user, report_identifier) + process_instance_report = ProcessInstanceReportService.report_with_identifier( + g.user, report_identifier + ) if user_filter: report_filter = ProcessInstanceReportFilter( 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 541bdee2..df302934 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 @@ -44,15 +44,14 @@ class ProcessInstanceReportService: @classmethod def report_with_identifier( - cls, - user: UserModel, - report_identifier: Optional[str] = None + cls, user: UserModel, report_identifier: Optional[str] = None ) -> ProcessInstanceReportModel: + """Report_with_filter.""" if report_identifier is None: return ProcessInstanceReportModel.default_report(user) # TODO replace with system reports that are loaded on launch (or similar) - temp_system_metdata_map = { + temp_system_metadata_map = { "system_report_instances_initiated_by_me": { "columns": [ {"Header": "id", "accessor": "id"}, @@ -91,8 +90,8 @@ class ProcessInstanceReportService: }, } - process_instance_report = cls( - identifier=identifier, + process_instance_report = ProcessInstanceReportModel( + identifier=report_identifier, created_by_id=user.id, report_metadata=temp_system_metadata_map[report_identifier], )