X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ee4f3e79135a34ad7ed845453adbe8dfc1e420c1..a9d6b8ff42fe6dae988f8157d1b814e2169ce941:/apps/cover/views.py diff --git a/apps/cover/views.py b/apps/cover/views.py index 6b3344b4..607d8088 100644 --- a/apps/cover/views.py +++ b/apps/cover/views.py @@ -15,7 +15,6 @@ from catalogue.models import Chunk from cover.models import Image from cover import forms - PREVIEW_SIZE = (216, 300) @@ -46,7 +45,7 @@ def preview(request, book, chunk=None, rev=None): except: return HttpResponseRedirect(os.path.join(settings.STATIC_URL, "img/sample_cover.png")) cover = DefaultEbookCover(info) - response = HttpResponse(mimetype=cover.mime_type()) + response = HttpResponse(content_type=cover.mime_type()) image = cover.image().resize(PREVIEW_SIZE, Image.ANTIALIAS) image.save(response, cover.format) return response @@ -107,8 +106,6 @@ def image(request, pk): @active_tab('cover') def image_list(request): - objects = Image.objects.all() - enable_add = request.user.has_perm('cover.add_image') return render(request, "cover/image_list.html", { 'object_list': Image.objects.all(), 'can_add': request.user.has_perm('cover.add_image'),