-
Notifications
You must be signed in to change notification settings - Fork 7
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
flow_approver #128
flow_approver #128
Conversation
…desk into approvers_provider
@LeoQuote 基本功能应该差不多,有空review一下? |
helpdesk/models/db/ticket.py
Outdated
@@ -209,7 +229,8 @@ def check_confirmed(self): | |||
|
|||
def set_approval_log(self, by_user=SYSTEM_USER, operated_type="approved"): | |||
approval_log = self.annotation.get("approval_log") | |||
approval_log.append(dict(node=self.annotation.get("current_node"), approver=by_user, operated_type=operated_type, operated_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S"))) | |||
operated_at = datetime.now().astimezone(timezone('Asia/Shanghai')).strftime("%Y-%m-%d %H:%M:%S") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
保持现状? 记录 utc 时间如何? 以前是记录什么时间的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也可以,之前就是utc时间
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就 utc 时间, 通知渲染的时候再转成当地时间
helpdesk/views/api/index.py
Outdated
@@ -162,6 +162,8 @@ async def ticket_op(ticket_id: int, op: str, | |||
"申请人才可主动关闭工单" | |||
if ticket.submitter != current_user.name: | |||
raise HTTPException(status_code=403, detail='Permission denied, only submitter can close') | |||
if ticket.status != "pending": | |||
raise HTTPException(status_code=403, detail='Permission denied, can not close in this ticket status') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise HTTPException(status_code=403, detail='Permission denied, can not close in this ticket status') | |
raise HTTPException(status_code=400, detail='Ticket not pending, can not be closed') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
related: #114
审批流后续开发: