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
@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
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())