fix: BUG-038 (audit log for tags/tasks/wiki/mail/calendar), BUG-072 (workflow instance), BUG-052 (miniapps), BUG-047 (approvals), BUG-037 (compliance), BUG-030 (GRANT DELETE), BUG-016 (search use_ai), BUG-014 (tags assign), BUG-009 (contact folders), BUG-073 (broken imports)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -11,6 +11,7 @@ from app.core.db import get_db
|
||||
from app.deps import get_current_user, require_permission
|
||||
from app.plugins.builtins.tasks import services
|
||||
from app.plugins.builtins.tasks.schemas import (
|
||||
from app.core.audit import log_audit
|
||||
TaskAssignRequest,
|
||||
TaskCreate,
|
||||
TaskDependencyRequest,
|
||||
@@ -80,7 +81,10 @@ async def create_task(
|
||||
tenant_id = uuid.UUID(current_user["tenant_id"])
|
||||
user_id = uuid.UUID(current_user["user_id"])
|
||||
data = body.model_dump()
|
||||
return await services.create_task(db, tenant_id, user_id, data)
|
||||
result = await services.create_task(db, tenant_id, user_id, data)
|
||||
if result and result.get("id"):
|
||||
await log_audit(db, tenant_id, user_id, "create", "task", uuid.UUID(result["id"]), changes={"title": data.get("title", "")})
|
||||
return result
|
||||
|
||||
|
||||
@router.get("/{task_id}", dependencies=[Depends(require_permission("tasks:read"))])
|
||||
@@ -127,6 +131,7 @@ async def delete_task(
|
||||
deleted = await services.delete_task(db, tenant_id, tid)
|
||||
if not deleted:
|
||||
raise HTTPException(404, detail={"detail": "Task not found", "code": "not_found"})
|
||||
await log_audit(db, tenant_id, user_id, "delete", "task", tid)
|
||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user