do not send empty reviews list

This commit is contained in:
j 2011-08-09 10:37:37 +02:00
parent 4760516c0a
commit e47c8e8da3

View file

@ -437,6 +437,8 @@ class Item(models.Model):
if 'reviews' in i: if 'reviews' in i:
i['reviews'] = self.reviews() i['reviews'] = self.reviews()
if not i['reviews']:
del i['reviews']
if 'cast' in i and isinstance(i['cast'][0], basestring): if 'cast' in i and isinstance(i['cast'][0], basestring):
i['cast'] = [i['cast']] i['cast'] = [i['cast']]
if 'cast' in i and isinstance(i['cast'][0], list): if 'cast' in i and isinstance(i['cast'][0], list):