clear empty metadata values on edit, fixes #440

This commit is contained in:
j 2012-02-13 16:50:34 +05:30
parent af647a86ac
commit ff1ce07e26

View file

@ -226,7 +226,11 @@ class Item(models.Model):
d.description = data.pop(key) d.description = data.pop(key)
d.save() d.save()
for key in data: for key in data:
self.data[key] = data[key] if data[key] == None:
if key in self.data:
del self.data[key]
else:
self.data[key] = data[key]
return self.save() return self.save()
def log(self): def log(self):