Skip to content

Commit

Permalink
允许提交人在任何时候取消执行工单 fix #1470
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Apr 30, 2022
1 parent eb999f1 commit 969b861
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sql/utils/sql_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,18 @@ def can_timingtask(user, workflow_id):
def can_cancel(user, workflow_id):
"""
判断用户当前是否是可终止,
审核中的工单,审核人和提交人可终止
审核通过但未执行的工单,有执行权限的用户终止
审核中、审核通过的的工单,审核人和提交人可终止
:param user:
:param workflow_id:
:return:
"""
workflow_detail = SqlWorkflow.objects.get(id=workflow_id)
result = False
# 审核中的工单,审核人和提交人可终止
if workflow_detail.status == 'workflow_manreviewing':
if workflow_detail.status in ['workflow_manreviewing', 'workflow_review_pass', 'workflow_timingtask']:
from sql.utils.workflow_audit import Audit
if Audit.can_review(user, workflow_id, 2) or user.username == workflow_detail.engineer:
result = True
# 审核通过但未执行的工单,执行人可以打回
if workflow_detail.status in ['workflow_review_pass', 'workflow_timingtask']:
result = True if can_execute(user, workflow_id) else False
return result


Expand Down

0 comments on commit 969b861

Please sign in to comment.