X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4cab8b0725fd5a88f5a508e584b4acd346a824fc..6c81c82481a5407bc6e4f3c5cdd16baedbc2a523:/src/wiki/views.py?ds=sidebyside 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,