From c1738fc346facabe0658de3008e8097621b5ef53 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 23 Feb 2012 23:16:02 +0530 Subject: [PATCH] dont fail if sort was not set, fix logs dialog --- pandora/archive/views.py | 5 +++-- static/js/pandora/logsDialog.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 04b177516..bebc66854 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -375,8 +375,9 @@ def removeFiles(request): if request.user.get_profile().get_level() == 'admin': qs = models.File.objects.filter(oshash__in=data['ids'], instances__id=None) for f in qs: - f.item.sort.numberoffiles -= 1 - f.item.sort.save() + if f.item.sort.numberoffiles: + f.item.sort.numberoffiles -= 1 + f.item.sort.save() qs.delete() else: response = json_response(status=403, text='permissino denied') diff --git a/static/js/pandora/logsDialog.js b/static/js/pandora/logsDialog.js index 6aa8da966..dffa93c46 100644 --- a/static/js/pandora/logsDialog.js +++ b/static/js/pandora/logsDialog.js @@ -81,7 +81,7 @@ pandora.ui.logsDialog = function() { width: 144 }, { - format: function(value) { + format: function(value, data) { return formatURL(value, data.line); }, id: 'url',