Skip to content

Commit

Permalink
[STTNHUB-380] improve: Expose Coverage Schedule when restrict_coverag…
Browse files Browse the repository at this point in the history
…e_info is on
  • Loading branch information
MarkLark86 committed Jan 7, 2025
1 parent 3222d0f commit ad0868d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 8 additions & 8 deletions features/web_api/agenda_restrict_coverage_details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
Expand All @@ -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__"
}
}, {
Expand All @@ -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__"
}
}]
Expand Down Expand Up @@ -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__"
Expand All @@ -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__"
}
}, {
Expand Down Expand Up @@ -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__"
Expand Down
6 changes: 5 additions & 1 deletion newsroom/agenda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ def remove_restricted_coverage_info(items):
"delivery_id",
"delivery_href",
"deliveries",
"scheduled",
"g2_content_type",
)

planning_keys_to_copy = (
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ad0868d

Please sign in to comment.