remove list option from addDocument, fixes #2032
This commit is contained in:
parent
07f6e46509
commit
49057ac14a
1 changed files with 11 additions and 13 deletions
|
@ -23,9 +23,7 @@ def addDocument(request):
|
|||
'''
|
||||
add document(s) to item
|
||||
takes {
|
||||
item: string
|
||||
or:
|
||||
list: string
|
||||
item: string or [string]
|
||||
|
||||
id: string
|
||||
or
|
||||
|
@ -41,6 +39,7 @@ def addDocument(request):
|
|||
else:
|
||||
ids = [data['id']]
|
||||
if 'item' in data:
|
||||
if isinstance(data['item'], basestring):
|
||||
item = Item.objects.get(itemId=data['item'])
|
||||
if item.editable(request.user):
|
||||
for id in ids:
|
||||
|
@ -48,9 +47,8 @@ def addDocument(request):
|
|||
document.add(item)
|
||||
else:
|
||||
response = json_response(status=403, text='permission denied')
|
||||
elif 'list' in data:
|
||||
list = List.get(data['list'])
|
||||
for item in list.get_items(request.user):
|
||||
else:
|
||||
for item in Item.objects.filter(itemId__in=data['item']):
|
||||
if item.editable(request.user):
|
||||
for id in ids:
|
||||
document = models.Document.get(id)
|
||||
|
|
Loading…
Reference in a new issue