check download url for duplicated when refreshing covers
[redakcja.git] / apps / cover / views.py
index 6b3344b..607d808 100644 (file)
@@ -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'),