Merge pull request #7505 from jumpserver/pr@dev@ticket_bug

fix: 修复工单审批后state不准问题
This commit is contained in:
feng626 2022-01-17 15:51:49 +08:00 committed by GitHub
commit d2b3edffca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,7 +195,8 @@ class Ticket(CommonModelMixin, OrgModelMixin):
def update_current_step_state_and_assignee(self, processor, state): def update_current_step_state_and_assignee(self, processor, state):
if self.status_closed: if self.status_closed:
raise AlreadyClosed raise AlreadyClosed
self.state = state if state != TicketState.approved:
self.state = state
current_node = self.current_node current_node = self.current_node
current_node.update(state=state) current_node.update(state=state)
current_node.first().ticket_assignees.filter(assignee=processor).update(state=state) current_node.first().ticket_assignees.filter(assignee=processor).update(state=state)