precommit is passing w/ burnettk

This commit is contained in:
jasquat 2022-07-11 16:56:50 -04:00
parent fbbdf7cbcc
commit 3c2ea5f686
4 changed files with 16 additions and 13 deletions

View File

@ -1,5 +1,3 @@
from __future__ import with_statement
import logging
from logging.config import fileConfig

View File

@ -58,7 +58,10 @@ class ProcessInstanceReportModel(SpiffworkflowBaseDBModel):
__tablename__ = "process_instance_report"
__table_args__ = (
db.UniqueConstraint(
"process_group_identifier", "process_model_identifier", "identifier", name="process_instance_report_unique"
"process_group_identifier",
"process_model_identifier",
"identifier",
name="process_instance_report_unique",
),
)

View File

@ -13,7 +13,9 @@ from flask_bpmn.models.db import db
from werkzeug.wrappers.response import Response
from spiffworkflow_backend.models.principal import PrincipalModel
from spiffworkflow_backend.models.process_instance_report import ProcessInstanceReportModel
from spiffworkflow_backend.models.process_instance_report import (
ProcessInstanceReportModel,
)
from spiffworkflow_backend.models.user import UserModel
from spiffworkflow_backend.services.process_instance_processor import (
ProcessInstanceProcessor,

View File

@ -414,26 +414,25 @@ def process_instance_report_list(
def process_instance_report_create(
process_group_id: str, process_model_id: str,
body: Dict[str, Any]
process_group_id: str, process_model_id: str, body: Dict[str, Any]
) -> flask.wrappers.Response:
"""Process_instance_report_create."""
ProcessInstanceReportModel.create_report(
identifier=body['identifier'],
identifier=body["identifier"],
process_group_identifier=process_group_id,
process_model_identifier=process_model_id,
user=g.user,
report_metadata=body['report_metadata'],
report_metadata=body["report_metadata"],
)
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
def process_instance_report_update(
process_group_id: str, process_model_id: str,
process_group_id: str,
process_model_id: str,
report_identifier: str,
body: Dict[str, Any]
body: Dict[str, Any],
) -> flask.wrappers.Response:
"""Process_instance_report_create."""
process_instance_report = ProcessInstanceReportModel.query.filter_by(
@ -448,14 +447,15 @@ def process_instance_report_update(
status_code=404,
)
process_instance_report.report_metadata = body['report_metadata']
process_instance_report.report_metadata = body["report_metadata"]
db.session.commit()
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
def process_instance_report_delete(
process_group_id: str, process_model_id: str,
process_group_id: str,
process_model_id: str,
report_identifier: str,
) -> flask.wrappers.Response:
"""Process_instance_report_create."""