Skip to content

Commit

Permalink
fix: WorkflowExecutionsPaginatedResultsDto expects WorkflowExecutionD…
Browse files Browse the repository at this point in the history
…TO instances (#2998)
  • Loading branch information
VladimirFilonov authored Jan 8, 2025
1 parent 0da8d31 commit 2f2b5df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keep/api/routes/incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
SplitIncidentResponseDto,
)
from keep.api.models.db.alert import AlertActionType, AlertAudit
from keep.api.models.workflow import WorkflowExecutionDTO
from keep.api.routes.alerts import _enrich_alert
from keep.api.tasks.process_incident_task import process_incident
from keep.api.utils.enrichment_helpers import convert_db_alerts_to_dto_alerts
Expand Down Expand Up @@ -471,7 +472,7 @@ def get_incident_workflows(
"Fetching incident's workflows",
extra={"incident_id": incident_id, "tenant_id": tenant_id},
)
workflow_execution_dtos, total_count = (
workflow_executions, total_count = (
get_workflow_executions_for_incident_or_alert(
tenant_id=tenant_id,
incident_id=str(incident_id),
Expand All @@ -480,6 +481,8 @@ def get_incident_workflows(
)
)

workflow_execution_dtos = [WorkflowExecutionDTO(**we._mapping) for we in workflow_executions]

paginated_workflow_execution_dtos = WorkflowExecutionsPaginatedResultsDto(
limit=limit, offset=offset, count=total_count, items=workflow_execution_dtos
)
Expand Down

0 comments on commit 2f2b5df

Please sign in to comment.