From cc2e7d5fcf2f9375b923baf1e159cc15a179efa4 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 29 Aug 2022 10:05:57 -0400 Subject: [PATCH] use any old user and add fixtures for ticket reports during ticket import --- bin/import_tickets_for_script_task.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/import_tickets_for_script_task.py b/bin/import_tickets_for_script_task.py index 27921124..3497216d 100644 --- a/bin/import_tickets_for_script_task.py +++ b/bin/import_tickets_for_script_task.py @@ -15,6 +15,7 @@ def main(): from spiffworkflow_backend.services.process_instance_service import ( ProcessInstanceService, ) + from spiffworkflow_backend.models.process_instance_report import ProcessInstanceReportModel process_model_identifier_ticket = "ticket" db.session.query(ProcessInstanceModel).filter( @@ -42,7 +43,7 @@ def main(): } columns_to_header_index_mappings = {} - user = UserModel.query.filter_by(username="test_user1").first() + user = UserModel.query.first() with open("tests/files/tickets.csv") as infile: reader = csv.reader(infile, delimiter=",") @@ -97,6 +98,9 @@ def main(): process_instance_data = processor.get_data() print(f"process_instance_data: {process_instance_data}") + ProcessInstanceReportModel.add_fixtures() + print("added report fixtures") + main()