fix document import
This commit is contained in:
parent
272810b9c2
commit
ce234bdea5
4 changed files with 19 additions and 10 deletions
5
views.py
5
views.py
|
|
@ -2,14 +2,15 @@
|
|||
from __future__ import division, print_function, absolute_import
|
||||
|
||||
from oxdjango.decorators import login_required_json
|
||||
from oxdjango.shortcuts import render_to_json_response
|
||||
from oxdjango.shortcuts import render_to_json_response, json_response
|
||||
from oxdjango.api import actions
|
||||
|
||||
from .tasks import import_documents
|
||||
|
||||
@login_required_json
|
||||
def importDocuments(request, data):
|
||||
t = tasks.import_documents.delay(urls=data['urls'])
|
||||
response = json_response({})
|
||||
t = import_documents.delay(urls=data['urls'])
|
||||
response['data']['taskId'] = t.task_id
|
||||
return render_to_json_response(response)
|
||||
actions.register(importDocuments)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue