Skip to content

Commit

Permalink
Changed 'args' to 'data'
Browse files Browse the repository at this point in the history
  • Loading branch information
liiight committed Mar 30, 2016
1 parent 2199919 commit 8805931
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flexget/api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,20 @@ class TaskExecutionAPI(APIResource):
@api.validate(task_execution_schema, description=entry_doc)
def post(self, task, session=None):
""" Execute task and stream results """
args = request.json
data = request.json

if task.lower() not in [t.lower() for t in self.manager.user_config.get('tasks', {}).keys()]:
return {'error': 'task does not exist'}, 404

queue = ExecuteLog()
output = queue if args.get('log') else None
output = queue if data.get('log') else None
stream = True if any(
arg[0] in ['progress', 'summary', 'log', 'entry_dump'] for arg in args.items() if arg[1]) else False
arg[0] in ['progress', 'summary', 'log', 'entry_dump'] for arg in data.items() if arg[1]) else False
options = {'tasks': [task]}

if args.get('inject'):
if data.get('inject'):
entries = []
for item in args.get('inject'):
for item in data.get('inject'):
entry = Entry()
entry['url'] = item['url']
if not item.get('title'):
Expand Down Expand Up @@ -353,7 +353,7 @@ def post(self, task, session=None):
_streams[task_id] = {
'queue': queue,
'last_update': datetime.now(),
'args': args
'args': data
}

def stream_response():
Expand Down

0 comments on commit 8805931

Please sign in to comment.