This commit is contained in:
zlwu committed 2026-10-17 11:46:53 +08:00
1 parent 48dcf991dc
commit be2226e4ca
100 files changed
+61340 -40975

No files matched your search

+1 -9
View File
@@ -210,11 +210,7 @@ def _comment_to_dict(
if not isinstance(refs, list):
refs = []
status = (row.status or "normal").strip() or "normal"
can_revoke = (
status == "normal"
and instance_status == "running"
and (row.create_by or "") == (viewer_user_id or "")
)
can_revoke = status == "normal" and (row.create_by or "") == (viewer_user_id or "")
return {
"id": row.id,
"instanceId": row.instance_id,
@@ -420,8 +416,6 @@ def create_comment(
mention_user_ids: Optional[List[str]] = None,
) -> Dict[str, Any]:
inst = _get_instance(db, instance_id, tenant_no)
if (inst.status or "") != "running":
raise OaEngineError("仅审批进行中可评论")
text = (content or "").strip()
if len(text) > CONTENT_MAX:
raise OaEngineError(f"评论内容不能超过{CONTENT_MAX}字")
@@ -485,8 +479,6 @@ def revoke_comment(
user_id: str,
) -> Dict[str, Any]:
inst = _get_instance(db, instance_id, tenant_no)
if (inst.status or "") != "running":
raise OaEngineError("仅审批进行中可撤回评论")
row = (
db.query(OaInstanceComment)
.filter(