forked from 0x2620/pandora
clear empty metadata values on edit, fixes #440
This commit is contained in:
parent
af647a86ac
commit
ff1ce07e26
1 changed files with 5 additions and 1 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue