From 7ac91403aed7a1fc007ae131fa7ca91d71cc120a Mon Sep 17 00:00:00 2001 From: MarkLark86 Date: Thu, 22 Feb 2024 17:15:51 +1100 Subject: [PATCH] [STTNHUB-313] api: Allow passing item state to assignments_link endpoint (#1920) --- server/planning/assignments/assignments_link.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/planning/assignments/assignments_link.py b/server/planning/assignments/assignments_link.py index 29c9d071e..816d28ffb 100644 --- a/server/planning/assignments/assignments_link.py +++ b/server/planning/assignments/assignments_link.py @@ -78,7 +78,7 @@ def link_archive_items_to_assignments(self, assignment, related_items, actioned_ "assignment_id": assignment.get(config.ID_FIELD), "planning_id": assignment["planning_item"], "coverage_id": assignment["coverage_item"], - "item_state": item.get("state"), + "item_state": doc.get("item_state") or item.get("state"), "sequence_no": item.get("rewrite_sequence") or 0, "publish_time": get_delivery_publish_time(item), "scheduled_update_id": assignment.get("scheduled_update_id"), @@ -252,6 +252,7 @@ class AssignmentsLinkResource(Resource): schema = { "assignment_id": {"type": "objectid", "required": True}, "item_id": {"type": "string", "required": True}, + "item_state": {"type": "string"}, "reassign": {"type": "boolean", "required": True}, "force": {"type": "boolean"}, "skip_archive_update": {"type": "boolean"},