From b4b8e0823150848b7a1f0b33141161b0950c135a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 8 Jan 2014 08:35:02 +0000 Subject: [PATCH] fix adding items to empty list --- pandora/document/views.py | 2 +- static/js/documentsPanel.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/document/views.py b/pandora/document/views.py index 9916b56d..19095465 100644 --- a/pandora/document/views.py +++ b/pandora/document/views.py @@ -169,7 +169,7 @@ def findDocuments(request): Sum('size') ) response['data']['items'] = qs.count() - response['data']['size'] = r['size__sum'] + response['data']['size'] = r['size__sum'] or 0 return render_to_json_response(response) actions.register(findDocuments) diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 9a44ea70..d1fe572f 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -405,7 +405,7 @@ pandora.ui.documentsPanel = function(options) { } function editDocuments() { - pandora.UI.set('documentSelection.', $list.options('selected')); + pandora.UI.set('documentsSelection.', $list.options('selected')); pandora.$ui.documentsDialog = pandora.ui.documentsDialog().open(); } @@ -573,7 +573,7 @@ pandora.ui.documentsPanel = function(options) { conditions: isItemView ? [{ key: 'item', value: ui.item, operator: '==' }] : [], operator: '&' }, - selected: ui.documentsSelection[isItemView ? ui.item : ''], + selected: ui.documentsSelection[isItemView ? ui.item : ''] || [], sort: ui.documentsSort.concat([ {key: 'extension', operator: '+'}, {key: 'name', operator: '+'}