X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/05f67adb27390c7a9cf214e83550d3bbca88c8f2..9d46c06a996800009e85b5481b7d6bd6d7e2082b:/apps/cover/views.py diff --git a/apps/cover/views.py b/apps/cover/views.py index 0c29209c..3d30a2a5 100644 --- a/apps/cover/views.py +++ b/apps/cover/views.py @@ -25,7 +25,7 @@ def preview(request, book, chunk=None, rev=None): If chunk and rev number are given, use version from given revision. If rev is not given, use publishable version. """ - import Image + from PIL import Image from librarian.cover import WLCover from librarian.dcparser import BookInfo @@ -56,7 +56,7 @@ def preview(request, book, chunk=None, rev=None): @require_POST def preview_from_xml(request): from hashlib import sha1 - import Image + from PIL import Image from os import makedirs from lxml import etree from librarian.cover import WLCover @@ -125,7 +125,7 @@ def add_image(request): if ff.is_valid(): form = forms.ImageAddForm(ff.cleaned_data) else: - form = forms.ImageAddForm(request.POST) + form = forms.ImageAddForm(request.POST, request.FILES) if form.is_valid(): obj = form.save() return HttpResponseRedirect(obj.get_absolute_url())