Revert "Properly populate Worklist.items in automatic worklists"

This patch made it impossible to view a list of boards in the
webclient for storyboard.openstack.org, since some of the boards
in that instance display some unusual behaviour. It also is still
too slow for worklists to be retrieved in a reasonable time.

This reverts commit bdc0ead231.

Change-Id: I7ac23cd678ebd1481d1b80ac737188ea291c49a9
This commit is contained in:
Adam Coldrick 2018-02-28 01:17:30 +00:00
parent bdc0ead231
commit a2f80b2335
2 changed files with 6 additions and 20 deletions

View File

@ -896,21 +896,14 @@ class Lane(base.APIBase):
self.worklist = Worklist.from_db_model(lane.worklist)
self.worklist.resolve_permissions(lane.worklist)
self.worklist.resolve_filters(lane.worklist)
user_id = request.current_user_id
if resolve_items:
self.worklist.resolve_items(
lane.worklist, story_cache, task_cache)
elif not lane.worklist.automatic:
else:
items = worklists_api.get_visible_items(
lane.worklist, current_user=user_id)
lane.worklist, current_user=request.current_user_id)
self.worklist.items = [WorklistItem.from_db_model(item)
for item in items]
else:
self.worklist.items = [
WorklistItem(**item)
for item in worklists_api.filter_items(
lane.worklist, user_id)[0]
]
class Board(base.APIBase):

View File

@ -702,17 +702,10 @@ class WorklistsController(rest.RestController):
worklist_model.resolve_permissions(worklist)
visible_items = worklists_api.get_visible_items(
worklist, request.current_user_id)
if not worklist.automatic:
worklist_model.items = [
wmodels.WorklistItem.from_db_model(item)
for item in visible_items
]
else:
worklist_model.items = [
wmodels.WorklistItem(**item)
for item in worklists_api.filter_items(
worklist, request.current_user_id)[0]
]
worklist_model.items = [
wmodels.WorklistItem.from_db_model(item)
for item in visible_items
]
visible_worklists.append(worklist_model)
# Apply the query response headers