From b8cbc66e9dc1fbb666f476421eb3cc43a40c1189 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 19 Jun 2011 17:54:10 +0530 Subject: [PATCH] page order fixed --- edgware/editor/views.py | 2 +- edgware/files/convert.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/edgware/editor/views.py b/edgware/editor/views.py index 120c0d8..608fea3 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -643,7 +643,7 @@ def article_pdf(request): 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) - pages = Page.objects.filter(article=article) + 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) # url_list = [url] diff --git a/edgware/files/convert.py b/edgware/files/convert.py index 38ddd2e..5e19a3e 100644 --- a/edgware/files/convert.py +++ b/edgware/files/convert.py @@ -55,13 +55,13 @@ def convertFile(**kwargs): fname = str(f.file) ext = e.models.extFileName(fname) f.ext = ext - if f.ext in ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG']: + if f.ext.lower() in ['jpg', 'jpeg', 'png']: f.type = 'image' - elif f.ext in ['ogg', 'oga']: + elif f.ext.lower() in ['ogg', 'oga']: f.type = 'audio' - elif f.ext in ['ogv']: + elif f.ext.lower() in ['ogv']: f.type = 'video' - elif f.ext in ['doc', 'pdf', 'rtf', 'txt']: + elif f.ext.lower() in ['doc', 'pdf', 'rtf', 'txt']: f.type = 'text' else: f.type = 'other'