Moved some task fetching functionality into TaskManager.
This commit is contained in:
@@ -24,16 +24,7 @@ def index():
|
||||
if not user.is_authenticated:
|
||||
return render_template('attract/tasks/index.html')
|
||||
|
||||
api = pillar_api()
|
||||
|
||||
# TODO: also include tasks assigned to any of the user's groups.
|
||||
tasks = pillarsdk.Node.all({
|
||||
'where': {
|
||||
'properties.assigned_to.users': user.objectid,
|
||||
'node_type': node_type_task['name'],
|
||||
}
|
||||
}, api=api)
|
||||
|
||||
tasks = current_attract.task_manager.tasks_for_user(user.objectid)
|
||||
return render_template('attract/tasks/for_user.html',
|
||||
tasks=tasks['_items'],
|
||||
task_count=tasks['_meta']['total'])
|
||||
@@ -52,14 +43,7 @@ def delete(task_id):
|
||||
@perproject_blueprint.route('/', endpoint='index')
|
||||
@attract_project_view()
|
||||
def for_project(project, task_id=None):
|
||||
api = pillar_api()
|
||||
|
||||
tasks = pillarsdk.Node.all({
|
||||
'where': {
|
||||
'project': project['_id'],
|
||||
'node_type': node_type_task['name'],
|
||||
}}, api=api)
|
||||
|
||||
tasks = current_attract.task_manager.tasks_for_project(project['_id'])
|
||||
return render_template('attract/tasks/for_project.html',
|
||||
tasks=tasks['_items'],
|
||||
open_task_id=task_id,
|
||||
|
Reference in New Issue
Block a user