oops, math.ceil applied at wrong place

This commit is contained in:
Sanj 2011-06-21 01:36:08 +05:30
parent f08407c3b9
commit fc7d7314ba

View File

@ -519,6 +519,7 @@ def view_article(request, id):
page_height = article.view_size()[1]
return render_to_response("view_article.html", {'pages': d, 'm': m, 'width': addPx(page_width), 'height': addPx(page_height)})
@login_required
def create_article(request):
if request.POST:
@ -642,7 +643,7 @@ def article_pdf(request):
article = get_object_or_404_json(Article, pk=a_id)
dpi = request.GET.get('dpi', 300)
width_mm = request.GET.get('width', article.typ.print_width)
height_mm = int(width_mm // article.typ.aspect_ratio)
height_mm = math.ceil(width_mm // article.typ.aspect_ratio)
pages = Page.objects.filter(article=article).order_by('page_no')
m = article.get_print_multiplier(dpi)
url = SITE_BASE + "/edit/view_article/%d/?m=%f" % (article.id, m)