From d1b87be006500e6e389572387a0dd39dce368498 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Wed, 4 Dec 2024 16:06:30 +0100 Subject: [PATCH] Use AppliedControlReadSerializer to serialize action plan controls --- backend/core/views.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/backend/core/views.py b/backend/core/views.py index be431f545..c8c22b5aa 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -1988,26 +1988,7 @@ def action_plan(self, request, pk): ) ) applied_controls = [ - { - "id": applied_control.id, - "name": applied_control.name, - "description": applied_control.description, - "status": applied_control.status, - "category": applied_control.category, - "csf_function": applied_control.csf_function, - "eta": applied_control.eta, - "expiry_date": applied_control.expiry_date, - "link": applied_control.link, - "effort": applied_control.effort, - "cost": applied_control.cost, - "owners": [ - { - "id": owner.id, - "email": owner.email, - } - for owner in applied_control.owner.all() - ], - } + AppliedControlReadSerializer(applied_control).data for applied_control in AppliedControl.objects.filter( requirement_assessments__in=requirement_assessments_objects ).distinct()