diff --git a/oml/changelog.py b/oml/changelog.py index a8efc67..ef7de1d 100644 --- a/oml/changelog.py +++ b/oml/changelog.py @@ -67,7 +67,10 @@ class Changelog(db.Model): # fixme remove c = cls() c.created = datetime.utcnow() - c.timestamp = datetime2ts(ts) + if ts: + c.timestamp = datetime2ts(ts) + else: + c.timestamp = datetime2ts(c.created) c.user_id = user.id c.revision = cls.query.filter_by(user_id=user.id).count() c.data = json.dumps([action] + list(args), ensure_ascii=False)