Update template json to return created_at and updated_at. Also fixed a bug where updated_at was not being added to the templates_history model.

This commit is contained in:
Nicholas Staples
2016-05-19 17:02:55 +01:00
parent e0f6b4e571
commit 1797d9360b
4 changed files with 8 additions and 1 deletions

View File

@@ -208,6 +208,9 @@ def create_history(obj):
obj.created_at = datetime.datetime.utcnow()
else:
obj.version += 1
now = datetime.datetime.utcnow()
obj.updated_at = now
data['updated_at'] = now
data['version'] = obj.version
data['created_at'] = obj.created_at