From 1257e46ba9dc952f2e596b1f377fc45925dfc3e1 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 9 Nov 2010 18:17:35 +0100 Subject: little pathchooser improvements --- module/web/pyload/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/web/pyload/views.py') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 8e08e408b..a9d3830ed 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -19,6 +19,7 @@ from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import HttpResponseNotFound +from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ @@ -397,8 +398,13 @@ def path(request, path): parentdir = os.path.split(cwd[:-1])[0] else: parentdir = os.path.split(cwd)[0] - - for f in os.listdir(cwd): + + try: + folders = os.listdir(cwd) + except: + folders = [] + + for f in folders: data = {'name': f[:50], 'size': '', 'modified': '', -- cgit v1.2.3