X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5eeb9dace6068f83e2b70b5222cfab0c0a5e71eb..aae8a623a8d2fbc6edf6cfc5f070c161084f37be:/apps/waiter/views.py?ds=sidebyside diff --git a/apps/waiter/views.py b/apps/waiter/views.py index e38bd8f1d..b951cc4c8 100644 --- a/apps/waiter/views.py +++ b/apps/waiter/views.py @@ -1,17 +1,22 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from os.path import join from waiter.models import WaitedFile from waiter.settings import WAITER_URL from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse +from django.views.decorators.cache import never_cache + +@never_cache def wait(request, path): if WaitedFile.exists(path): file_url = join(WAITER_URL, path) else: file_url = "" waiting = get_object_or_404(WaitedFile, path=path) - if waiting.is_stale(): - waiting = None if request.is_ajax(): return HttpResponse(file_url)