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
This commit is contained in:
Adam Coldrick 2019-02-09 12:42:47 +00:00
parent 7a296ac2c4
commit b26e34f486

View File

@ -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))