fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
whitespace
[redakcja.git]
/
apps
/
cover
/
views.py
diff --git
a/apps/cover/views.py
b/apps/cover/views.py
index
4bb6d50
..
4a6e575
100644
(file)
--- a/
apps/cover/views.py
+++ b/
apps/cover/views.py
@@
-46,7
+46,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)
except:
return HttpResponseRedirect(os.path.join(settings.STATIC_URL, "img/sample_cover.png"))
cover = DefaultEbookCover(info)
- response = HttpResponse(
mime
type=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
image = cover.image().resize(PREVIEW_SIZE, Image.ANTIALIAS)
image.save(response, cover.format)
return response
@@
-87,7
+87,7
@@
def image(request, pk):
if request.user.has_perm('cover.change_image'):
if request.method == "POST":
if request.user.has_perm('cover.change_image'):
if request.method == "POST":
- form = forms.ImageEditForm(request.POST, instance=image)
+ form = forms.ImageEditForm(request.POST,
request.FILES,
instance=image)
if form.is_valid():
form.save()
return HttpResponseRedirect(image.get_absolute_url())
if form.is_valid():
form.save()
return HttpResponseRedirect(image.get_absolute_url())