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:
parent
3db84cf215
commit
f34a175c34
@ -566,6 +566,7 @@ class SyncStoryTask(Task):
|
|||||||
story.creator = getUser(sync, session,
|
story.creator = getUser(sync, session,
|
||||||
remote_story['creator_id'])
|
remote_story['creator_id'])
|
||||||
story.created = parseDateTime(remote_story['created_at'])
|
story.created = parseDateTime(remote_story['created_at'])
|
||||||
|
story.private = remote_story['private']
|
||||||
|
|
||||||
if story.status != remote_story.get('status'):
|
if story.status != remote_story.get('status'):
|
||||||
status_changed = True
|
status_changed = True
|
||||||
@ -692,6 +693,8 @@ class SyncBoardTask(Task):
|
|||||||
local_lane_ids = set([l.id for l in board.lanes])
|
local_lane_ids = set([l.id for l in board.lanes])
|
||||||
remote_lane_ids = set()
|
remote_lane_ids = set()
|
||||||
for remote_lane in remote_lanes:
|
for remote_lane in remote_lanes:
|
||||||
|
if remote_lane['worklist']['archived']:
|
||||||
|
continue
|
||||||
remote_lane_ids.add(remote_lane['id'])
|
remote_lane_ids.add(remote_lane['id'])
|
||||||
if remote_lane['id'] not in local_lane_ids:
|
if remote_lane['id'] not in local_lane_ids:
|
||||||
self.log.debug("Adding to board id %s lane %s" %
|
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'])
|
lane.worklist = session.getWorklistByID(remote_lane['worklist']['id'])
|
||||||
for local_lane in board.lanes[:]:
|
for local_lane in board.lanes[:]:
|
||||||
if local_lane.id not in remote_lane_ids:
|
if local_lane.id not in remote_lane_ids:
|
||||||
session.delete(lane)
|
session.delete(local_lane)
|
||||||
|
|
||||||
def run(self, sync):
|
def run(self, sync):
|
||||||
app = sync.app
|
app = sync.app
|
||||||
@ -760,6 +763,8 @@ class SyncWorklistTask(Task):
|
|||||||
remote_item_ids = set()
|
remote_item_ids = set()
|
||||||
reenqueue = False
|
reenqueue = False
|
||||||
for remote_item in remote_items:
|
for remote_item in remote_items:
|
||||||
|
if remote_item['archived']:
|
||||||
|
continue
|
||||||
remote_item_ids.add(remote_item['id'])
|
remote_item_ids.add(remote_item['id'])
|
||||||
if remote_item['id'] not in local_item_ids:
|
if remote_item['id'] not in local_item_ids:
|
||||||
self.log.debug("Adding to worklist id %s item %s" %
|
self.log.debug("Adding to worklist id %s item %s" %
|
||||||
|
Loading…
x
Reference in New Issue
Block a user