descriptions should be empty not None

This commit is contained in:
j 2012-02-14 16:08:36 +05:30
parent fd5ed84a59
commit 6ca4edf742

View file

@ -222,8 +222,11 @@ class Item(models.Model):
key = '%sdescription' % k
if key in data:
value = data.get(k, self.get(k, ''))
description = data.pop(key)
if not description:
description = ''
d, created = Description.objects.get_or_create(key=k, value=value)
d.description = data.pop(key)
d.description = description
d.save()
for key in data:
if data[key] == None: