always record edititem

This commit is contained in:
j 2016-01-13 21:46:53 +05:30
parent 54d6d43fab
commit 4ad2fbf698

View file

@ -394,11 +394,9 @@ class Item(db.Model):
fd.write(content)
f.info = media.metadata(path)
f.save()
edititem = False
for key in ('tableofcontents', ):
if key not in self.meta and key in f.info:
self.meta[key] = f.info[key]
edititem = True
if u not in self.users:
self.add_user(u)
t = Transfer.get_or_create(self.id)
@ -406,8 +404,7 @@ class Item(db.Model):
t.save()
self.added = datetime.utcnow()
Changelog.record(u, 'additem', self.id, f.info)
if edititem:
Changelog.record(u, 'edititem', self.id, self.meta)
Changelog.record(u, 'edititem', self.id, self.meta)
self.update()
f.move()
self.update_icons()