From 2c5fe9db0901c5a81f66ecffe497ad2e7d9bb0e4 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 20 May 2014 00:59:02 +0200 Subject: [PATCH] dont loop --- oml/item/models.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/oml/item/models.py b/oml/item/models.py index 8276be9..ad6dbf7 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -270,13 +270,14 @@ class Item(db.Model): db.session.commit() def update_meta(self, data): - self.meta = data - self.update() - self.modified = datetime.now() - self.save() - user = state.user() - if user in self.users: - Changelog.record(user, 'edititem', self.id, data) + if data != self.meta: + self.meta = data + self.update() + self.modified = datetime.now() + self.save() + user = state.user() + if user in self.users: + Changelog.record(user, 'edititem', self.id, data) def update_mainid(self, key, id): record = {}