From a64835ef93c3207ed8a195ea97a419efca950f4d Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 29 Oct 2012 21:53:05 +0100 Subject: [PATCH] Try not to crash the ftp browser when there is a directory named README --- pgweb/downloads/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgweb/downloads/views.py b/pgweb/downloads/views.py index 730ae66f..6cdae8a3 100644 --- a/pgweb/downloads/views.py +++ b/pgweb/downloads/views.py @@ -74,9 +74,9 @@ def ftpbrowser(request, subpath): breadcrumbs.append({'name': pathpiece, 'path': breadroot}); # Check if there are any "content files" we should render directly on the webpage - file_readme = node.has_key('README') and node['README']['c'] or None; - file_message = node.has_key('.message') and node['.message']['c'] or None; - file_maintainer = node.has_key('CURRENT_MAINTAINER') and node['CURRENT_MAINTAINER']['c'] or None; + file_readme = (node.has_key('README') and node['README']['t']=='f') and node['README']['c'] or None; + file_message = (node.has_key('.message') and node['.message']['t']=='f') and node['.message']['c'] or None; + file_maintainer = (node.has_key('CURRENT_MAINTAINER') and node['CURRENT_MAINTAINER']['t'] == 'f') and node['CURRENT_MAINTAINER']['c'] or None; del node