pyl is passing

This commit is contained in:
jasquat 2022-11-21 18:31:51 -05:00
parent 153e006ee1
commit 6873cc65ac
5 changed files with 17 additions and 13 deletions

View File

@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
import dataclasses import dataclasses
import os
from dataclasses import dataclass from dataclasses import dataclass
from dataclasses import field from dataclasses import field
from typing import Any from typing import Any
@ -10,8 +11,6 @@ import marshmallow
from marshmallow import post_load from marshmallow import post_load
from marshmallow import Schema from marshmallow import Schema
import os
from spiffworkflow_backend.models.process_model import ProcessModelInfo from spiffworkflow_backend.models.process_model import ProcessModelInfo

View File

@ -33,15 +33,18 @@ class FileSystemService:
@staticmethod @staticmethod
def id_string_to_relative_path(id_string: str) -> str: def id_string_to_relative_path(id_string: str) -> str:
"""Id_string_to_relative_path."""
return id_string.replace("/", os.sep) return id_string.replace("/", os.sep)
@staticmethod @staticmethod
def process_group_path(name: str) -> str: def process_group_path(name: str) -> str:
"""Category_path.""" """Category_path."""
return os.path.abspath(os.path.join( return os.path.abspath(
FileSystemService.root_path(), os.path.join(
FileSystemService.id_string_to_relative_path(name) FileSystemService.root_path(),
)) FileSystemService.id_string_to_relative_path(name),
)
)
@staticmethod @staticmethod
def full_path_from_relative_path(relative_path: str) -> str: def full_path_from_relative_path(relative_path: str) -> str:

View File

@ -212,14 +212,16 @@ class DBHandler(logging.Handler):
bpmn_process_identifier = record.workflow # type: ignore bpmn_process_identifier = record.workflow # type: ignore
spiff_task_guid = str(record.task_id) # type: ignore spiff_task_guid = str(record.task_id) # type: ignore
bpmn_task_identifier = str(record.task_spec) # type: ignore bpmn_task_identifier = str(record.task_spec) # type: ignore
bpmn_task_name = record.task_name if hasattr(record, "task_name") else None bpmn_task_name = record.task_name if hasattr(record, "task_name") else None # type: ignore
bpmn_task_type = record.task_type if hasattr(record, "task_type") else None bpmn_task_type = record.task_type if hasattr(record, "task_type") else None # type: ignore
timestamp = record.created timestamp = record.created
message = record.msg if hasattr(record, "msg") else None message = record.msg if hasattr(record, "msg") else None
current_user_id = record.current_user_id if hasattr(record, "current_user_id") else None current_user_id = (
record.current_user_id if hasattr(record, "current_user_id") else None # type: ignore
)
spiff_step = ( spiff_step = (
record.spiff_step record.spiff_step # type: ignore
if hasattr(record, "spiff_step") and record.spiff_step is not None if hasattr(record, "spiff_step") and record.spiff_step is not None # type: ignore
else 1 else 1
) )
self.logs.append( self.logs.append(

View File

@ -1008,7 +1008,7 @@ class ProcessInstanceProcessor:
spiff_logger = logging.getLogger("spiff") spiff_logger = logging.getLogger("spiff")
for handler in spiff_logger.handlers: for handler in spiff_logger.handlers:
if hasattr(handler, "bulk_insert_logs"): if hasattr(handler, "bulk_insert_logs"):
handler.bulk_insert_logs() handler.bulk_insert_logs() # type: ignore
db.session.commit() db.session.commit()
except WorkflowTaskExecException as we: except WorkflowTaskExecException as we:

View File

@ -213,7 +213,7 @@ class ProcessModelService(FileSystemService):
process_group_path = os.path.abspath( process_group_path = os.path.abspath(
os.path.join( os.path.join(
FileSystemService.root_path(), FileSystemService.root_path(),
FileSystemService.id_string_to_relative_path(process_group_id) FileSystemService.id_string_to_relative_path(process_group_id),
) )
) )
if self.is_group(process_group_path): if self.is_group(process_group_path):