Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加离线导出工单,可通过查询页面右侧切换 #2685

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
1、优化导出工单审批方法的参数
2、增加测试配置参数
Wondermique committed Jun 24, 2024
commit ba1b7823dd06a8bf729456d7def57d688a1b0ee7
1 change: 1 addition & 0 deletions sql/test_notify.py
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@ def setUp(self):
instance=self.ins,
db_name="some_db",
syntax_type=1,
is_offline_export="no",
)
SqlWorkflowContent.objects.create(
workflow=self.wf, sql_content="some_sql", execute_result=""
9 changes: 5 additions & 4 deletions sql/utils/workflow_audit.py
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ class AuditV2:
# 归档表中没有下面两个参数, 所以对归档表来说一下两参数必传
resource_group: str = ""
resource_group_id: int = 0
offline_data: Optional[dict] = field(default_factory=dict)
# offline_data: Optional[dict] = field(default_factory=dict)

def __post_init__(self):
if not self.workflow:
@@ -235,7 +235,8 @@ def is_auto_review(self) -> bool:
):
# 影响行数超规模, 需要人工审核
return False
if self.offline_data["is_offline_export"] == "yes":
# if self.offline_data["is_offline_export"] == "yes":
if self.workflow.is_offline_export == "yes":
return False
return True

@@ -755,7 +756,7 @@ def get_auditor(
# 归档表中没有下面两个参数, 所以对归档表来说一下两参数必传
resource_group: str = "",
resource_group_id: int = 0,
offline_data: dict = None,
# offline_data: dict = None,
) -> AuditV2:
current_auditor = settings.CURRENT_AUDITOR
module, o = current_auditor.split(":")
@@ -767,5 +768,5 @@ def get_auditor(
audit=audit,
resource_group=resource_group,
resource_group_id=resource_group_id,
offline_data=offline_data,
# offline_data=offline_data,
)
3 changes: 2 additions & 1 deletion sql_api/serializers.py
Original file line number Diff line number Diff line change
@@ -439,7 +439,8 @@ def create(self, validated_data):
workflow=workflow, **validated_data
)
# 自动创建工作流
auditor = get_auditor(workflow=workflow, offline_data=workflow_data)
# auditor = get_auditor(workflow=workflow, offline_data=workflow_data)
auditor = get_auditor(workflow=workflow)
auditor.create_audit()
except Exception as e:
logger.error(f"提交工单报错,错误信息:{traceback.format_exc()}")
Loading