dont fail if sort was not set, fix logs dialog

This commit is contained in:
j 2012-02-23 23:16:02 +05:30
parent 748329f103
commit c1738fc346
2 changed files with 4 additions and 3 deletions

View file

@ -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')

View file

@ -81,7 +81,7 @@ pandora.ui.logsDialog = function() {
width: 144
},
{
format: function(value) {
format: function(value, data) {
return formatURL(value, data.line);
},
id: 'url',