From ad0868dc8e68dbf0fa85b6b6400180360cab3541 Mon Sep 17 00:00:00 2001 From: Mark Pittaway Date: Tue, 7 Jan 2025 11:25:03 +1100 Subject: [PATCH] [STTNHUB-380] improve: Expose Coverage Schedule when restrict_coverage_info is on --- .../agenda_restrict_coverage_details.feature | 16 ++++++++-------- newsroom/agenda/utils.py | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/features/web_api/agenda_restrict_coverage_details.feature b/features/web_api/agenda_restrict_coverage_details.feature index 288259312..7376ca0c2 100644 --- a/features/web_api/agenda_restrict_coverage_details.feature +++ b/features/web_api/agenda_restrict_coverage_details.feature @@ -209,14 +209,14 @@ Feature: Agenda Restricted Coverage Details "coverages": [{ "coverage_id": "plan1_cov1", "coverage_type": "text", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__", "workflow_status": "__no_value__", "coverage_status": "__no_value__" }, { "coverage_id": "plan1_cov2", "coverage_type": "text", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__", "workflow_status": "__no_value__", "coverage_status": "__no_value__" @@ -234,7 +234,7 @@ Feature: Agenda Restricted Coverage Details "g2_content_type": "text", "ednote": "__no_value__", "internal_note": "__no_value__", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__" } }, { @@ -245,7 +245,7 @@ Feature: Agenda Restricted Coverage Details "g2_content_type": "text", "ednote": "__no_value__", "internal_note": "__no_value__", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__" } }] @@ -276,7 +276,7 @@ Feature: Agenda Restricted Coverage Details "coverages": [{ "coverage_id": "plan1_cov1", "coverage_type": "text", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__", "workflow_status": "__no_value__", "coverage_status": "__no_value__" @@ -299,7 +299,7 @@ Feature: Agenda Restricted Coverage Details "g2_content_type": "text", "ednote": "__no_value__", "internal_note": "__no_value__", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__" } }, { @@ -366,14 +366,14 @@ Feature: Agenda Restricted Coverage Details "coverages": [{ "coverage_id": "plan1_cov1", "coverage_type": "text", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__", "workflow_status": "__no_value__", "coverage_status": "__no_value__" }, { "coverage_id": "plan1_cov2", "coverage_type": "text", - "scheduled": "__no_value__", + "scheduled": "2018-05-28T10:51:52+0000", "slugline": "__no_value__", "workflow_status": "__no_value__", "coverage_status": "__no_value__" diff --git a/newsroom/agenda/utils.py b/newsroom/agenda/utils.py index f4b6332a7..3ea91460e 100644 --- a/newsroom/agenda/utils.py +++ b/newsroom/agenda/utils.py @@ -222,6 +222,8 @@ def remove_restricted_coverage_info(items): "delivery_id", "delivery_href", "deliveries", + "scheduled", + "g2_content_type", ) planning_keys_to_copy = ( @@ -266,7 +268,9 @@ def remove_planning_info(plan_item): ] for coverage in plan["coverages"]: if not coverage_is_completed(coverage): - coverage["planning"] = {"g2_content_type": coverage["planning"]["g2_content_type"]} + coverage["planning"] = { + key: val for key, val in coverage["planning"].items() if key in coverage_keys_to_copy + } return items