Delete VPS document stage after verified local storage sync
This commit is contained in:
@@ -16,6 +16,7 @@ from app.modules.manager_dashboard.service import (
|
||||
get_next_manager_review_task_id,
|
||||
)
|
||||
from app.modules.services.execution import apply_task_review
|
||||
from app.modules.alerts.workflow_escalations import update_workflow_escalation
|
||||
|
||||
router = APIRouter(prefix="/manager", tags=["manager-dashboard-v2-ui"])
|
||||
|
||||
@@ -180,3 +181,17 @@ def manager_review_task_submit(
|
||||
return RedirectResponse(url=f"/manager/reviews/engagements/{subscription_id}?task_id={task_id}&reviewed=1", status_code=303)
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
@router.post("/escalations/{escalation_id}/action")
|
||||
def manager_escalation_action(request: Request, escalation_id: int, action: str = Form(...), resolution_note: str = Form(""), csrf_token: str = Form(...)):
|
||||
validate_csrf(request, csrf_token)
|
||||
db=CommonSessionLocal()
|
||||
try:
|
||||
current_user=get_current_user(request, db=db)
|
||||
if not current_user: return RedirectResponse(url="/login",status_code=303)
|
||||
if not can_access_manager_dashboard(db,current_user): return ui_access_denied()
|
||||
try: update_workflow_escalation(db, escalation_id=escalation_id, actor_user_id=current_user.id, action=action, resolution_note=resolution_note); db.commit()
|
||||
except ValueError: db.rollback()
|
||||
return RedirectResponse(url="/manager/dashboard?tab=escalations",status_code=303)
|
||||
finally: db.close()
|
||||
|
||||
Reference in New Issue
Block a user