From b26e34f486547ac13403b3d6153b36642cc5c386 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Sat, 9 Feb 2019 12:42:47 +0000 Subject: [PATCH] Stop passing new lanes' "worklist" key to add_lane This key is always either None or a Worklist wsme model. Also, passing None causes the list_id to end up null in the database, which leads to an integrity error. Change-Id: I5087064b77fea2a5a59ef7200cfa58e4f8c31925 Story: 2004948 Task: 29363 --- storyboard/api/v1/boards.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storyboard/api/v1/boards.py b/storyboard/api/v1/boards.py index b45dec7a..a5a10266 100644 --- a/storyboard/api/v1/boards.py +++ b/storyboard/api/v1/boards.py @@ -79,7 +79,7 @@ def update_lanes(board_dict, board_id): for lane in board_dict['lanes']: if lane.list_id not in existing_list_ids: - lane.worklist = None + del lane.worklist boards_api.add_lane(board, lane.as_dict(omit_unset=True)) events_api.board_lanes_changed_event(board_id, request.current_user_id, @@ -343,7 +343,8 @@ class BoardsController(rest.RestController): created_board.title, created_board.description) for lane in lanes: - boards_api.add_lane(created_board, lane.as_dict()) + del lane.worklist + boards_api.add_lane(created_board, lane.as_dict(omit_unset=True)) events_api.board_lanes_changed_event(created_board.id, user_id, added=serialize_lane(lane))