X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ae2a8df21e1038038cf898eb5a9d09b9ecc33f8f..ff58bad61fad779f3eeedccd01de4e7c07d94f1c:/src/cover/views.py diff --git a/src/cover/views.py b/src/cover/views.py index 39b12f91..5ea4a6c2 100644 --- a/src/cover/views.py +++ b/src/cover/views.py @@ -65,7 +65,11 @@ def preview(request, book, chunk=None, rev=None): cover_class = request.GET.get('cover_class', 'default') - cover = make_cover(info, cover_class=cover_class, width=width, height=height) + kwargs = {} + if chunk.book.project is not None: + if chunk.book.project.logo_mono or chunk.book.project.logo: + kwargs['cover_logo'] = (chunk.book.project.logo_mono or chunk.book.project.logo).path + cover = make_cover(info, cover_class=cover_class, width=width, height=height, **kwargs) response = HttpResponse(content_type=cover.mime_type()) img = cover.final_image() img.save(response, cover.format)