From 864b3abeea4d58718f4e04de96278e184af7857b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 5 Mar 2010 15:57:33 +0100 Subject: [PATCH] Dirty hack to fix gallery editing on some browsers --- apps/filebrowser/views.py | 4 ++-- apps/wiki/views.py | 5 ++++- platforma/templates/wiki/document_details.html | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/filebrowser/views.py b/apps/filebrowser/views.py index 32f79c22..30869a4d 100644 --- a/apps/filebrowser/views.py +++ b/apps/filebrowser/views.py @@ -63,9 +63,9 @@ def browse(request): dir_list = os.listdir(abs_path) files = [] - print "LISTING FILES: ", dir_list + # print "LISTING FILES: ", dir_list for file in dir_list: - print repr(file) + # print repr(file) # EXCLUDE FILES MATCHING VERSIONS_PREFIX OR ANY OF THE EXCLUDE PATTERNS filtered = file.startswith('.') for re_prefix in filter_re: diff --git a/apps/wiki/views.py b/apps/wiki/views.py index 4f808f0d..685e87e2 100644 --- a/apps/wiki/views.py +++ b/apps/wiki/views.py @@ -43,5 +43,8 @@ def document_gallery(request, directory): images = [u'%s%s%s/%s' % (settings.MEDIA_URL, settings.FILEBROWSER_DIRECTORY, directory, f) for f in os.listdir(base_dir) if os.path.splitext(f)[1].lower() in (u'.jpg', u'.jpeg', u'.png')] images.sort() return HttpResponse(json.dumps(images)) - except (IndexError, OSError), e: + except (IndexError, OSError), exc: + import traceback + traceback.print_exc() + raise Http404 diff --git a/platforma/templates/wiki/document_details.html b/platforma/templates/wiki/document_details.html index 43e5dfd3..1362a806 100644 --- a/platforma/templates/wiki/document_details.html +++ b/platforma/templates/wiki/document_details.html @@ -59,12 +59,12 @@