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:
parent
a02c8f9983
commit
2af0071972
1 changed files with 4 additions and 2 deletions
|
@ -85,8 +85,10 @@ class ItemView(BaseView):
|
||||||
@Lazy
|
@Lazy
|
||||||
def downloadUrl(self):
|
def downloadUrl(self):
|
||||||
urlInfo = self.context.externalURLInfo
|
urlInfo = self.context.externalURLInfo
|
||||||
extension = (mimeTypes.get(self.context.contentType) or ['bin'])[0]
|
extension = '.' + (mimeTypes.get(self.context.contentType) or ['bin'])[0]
|
||||||
return '%s/d%s/%s.%s' % (urlInfo.baseUrl, urlInfo.path, self.title, extension)
|
if self.title.endswith(extension):
|
||||||
|
extension = ''
|
||||||
|
return '%s/d%s/%s%s' % (urlInfo.baseUrl, urlInfo.path, self.title, extension)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def breadCrumbs(self):
|
def breadCrumbs(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue