1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from os.path import join
5 from waiter.models import WaitedFile
6 from waiter.settings import WAITER_URL
7 from django.shortcuts import render, get_object_or_404
8 from django.http import HttpResponse
9 from django.views.decorators.cache import never_cache
10 from wolnelektury.utils import is_ajax
14 def wait(request, path):
15 if WaitedFile.exists(path):
16 file_url = join(WAITER_URL, path)
20 waiting = get_object_or_404(WaitedFile, path=path)
23 return HttpResponse(file_url)
25 return render(request, "waiter/wait.html", {