From f34a175c3405364297a294987b1cd7004e7e9717 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 13 Mar 2018 16:51:26 -0700 Subject: [PATCH] Remove archived lanes and worklist items These should appear to us as having been deleted. Also, set the private flag on stories. Change-Id: Id111a83f0646a5a6d8d76342aa48ba826f6f454a --- boartty/sync.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boartty/sync.py b/boartty/sync.py index e6bc8c5..17b7aad 100644 --- a/boartty/sync.py +++ b/boartty/sync.py @@ -566,6 +566,7 @@ class SyncStoryTask(Task): story.creator = getUser(sync, session, remote_story['creator_id']) story.created = parseDateTime(remote_story['created_at']) + story.private = remote_story['private'] if story.status != remote_story.get('status'): status_changed = True @@ -692,6 +693,8 @@ class SyncBoardTask(Task): local_lane_ids = set([l.id for l in board.lanes]) remote_lane_ids = set() for remote_lane in remote_lanes: + if remote_lane['worklist']['archived']: + continue remote_lane_ids.add(remote_lane['id']) if remote_lane['id'] not in local_lane_ids: self.log.debug("Adding to board id %s lane %s" % @@ -709,7 +712,7 @@ class SyncBoardTask(Task): lane.worklist = session.getWorklistByID(remote_lane['worklist']['id']) for local_lane in board.lanes[:]: if local_lane.id not in remote_lane_ids: - session.delete(lane) + session.delete(local_lane) def run(self, sync): app = sync.app @@ -760,6 +763,8 @@ class SyncWorklistTask(Task): remote_item_ids = set() reenqueue = False for remote_item in remote_items: + if remote_item['archived']: + continue remote_item_ids.add(remote_item['id']) if remote_item['id'] not in local_item_ids: self.log.debug("Adding to worklist id %s item %s" %