From c343d3e9f8231822118ed3122e74002ddb923100 Mon Sep 17 00:00:00 2001 From: sanj Date: Wed, 28 Jul 2010 23:04:52 +0530 Subject: [PATCH] product undefined --- edgware/editor/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edgware/editor/views.py b/edgware/editor/views.py index 87ee417..eea1bf4 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -581,12 +581,12 @@ def article_pdf(request): article = get_object_or_404_json(Article, pk=a_id) dpi = request.GET.get('dpi', 150) width_mm = request.GET.get('width', article.product.typ.print_width) - height_mm = int(width_mm // product.typ.aspect_ratio) + height_mm = int(width_mm // article.product.typ.aspect_ratio) pages = Page.objects.filter(article=article) m = article.get_print_multiplier(dpi) url_list = [] for p in pages: - url = SITE_BASE + "/edit/view_article/%d/?m=%f&p=%d'" % (p.article.id, m, p.id) + url = SITE_BASE + "/edit/view_article/%d/?m=%f&p=%d'" % (article.id, m, article.product.id) url_list.append(url) output_path = MEDIA_ROOT + "/pdf/" + article.name + "_" + str(article.current_revision()) + ".pdf" pdf_path = print_url_list(url_list, width_mm, height_mm, output_path)