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
This commit is contained in:
James E. Blair 2018-03-13 16:51:26 -07:00
parent 3db84cf215
commit f34a175c34
1 changed files with 6 additions and 1 deletions

View File

@ -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" %