download URLs: don't add file extension to title if it ends already with the extension

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2966 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-11-03 10:51:50 +00:00
parent a02c8f9983
commit 2af0071972

View file

@ -85,8 +85,10 @@ class ItemView(BaseView):
@Lazy
def downloadUrl(self):
urlInfo = self.context.externalURLInfo
extension = (mimeTypes.get(self.context.contentType) or ['bin'])[0]
return '%s/d%s/%s.%s' % (urlInfo.baseUrl, urlInfo.path, self.title, extension)
extension = '.' + (mimeTypes.get(self.context.contentType) or ['bin'])[0]
if self.title.endswith(extension):
extension = ''
return '%s/d%s/%s%s' % (urlInfo.baseUrl, urlInfo.path, self.title, extension)
@property
def breadCrumbs(self):