X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4cab8b0725fd5a88f5a508e584b4acd346a824fc..689050858446fed8c38d8470be29f89f70cecf04:/src/wiki/views.py diff --git a/src/wiki/views.py b/src/wiki/views.py index 0b9cbc16..29c389a7 100644 --- a/src/wiki/views.py +++ b/src/wiki/views.py @@ -293,8 +293,15 @@ def history(request, chunk_id): if not doc.book.accessible(request): return HttpResponseForbidden("Not authorized.") + history = doc.history() + try: + before = int(request.GET.get('before')) + except: + pass + else: + history = history.filter(revision__lt=before) changes = [] - for change in doc.history().reverse(): + for change in history.reverse()[:20]: changes.append({ "version": change.revision, "description": change.description,