+ try:
+ doc = Chunk.get(slug, chunk).doc
+ except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
+ raise Http404
+
+ changes = []
+ for change in doc.history().order_by('-created_at'):
+ if change.author:
+ author = "%s %s <%s>" % (
+ change.author.first_name,
+ change.author.last_name,
+ change.author.email)
+ else:
+ author = None
+ changes.append({
+ "version": change.revision,
+ "description": change.description,
+ "author": author,
+ "date": change.created_at,
+ "tag": [],
+ })
+ return JSONResponse(changes)