Updated attachment's public title
authorThierry Florac <thierry.florac@onf.fr>
Fri, 26 Oct 2018 08:59:12 +0200
changeset 1040 d2485124991c
parent 1039 6ff6690ac4df
child 1041 e22f30b4ef3a
Updated attachment's public title
src/pyams_content/component/extfile/__init__.py
--- a/src/pyams_content/component/extfile/__init__.py	Wed Oct 24 16:36:51 2018 +0200
+++ b/src/pyams_content/component/extfile/__init__.py	Fri Oct 26 08:59:12 2018 +0200
@@ -87,7 +87,9 @@
         manager_info = IExtFileManagerInfo(request.root)
         title = II18n(self.context).query_attribute('title')
         if not title:
-            title, extension = self.context.filename.rsplit('.', 1)
+            title = self.context.filename
+            if '.' in title:
+                title, extension = title.rsplit('.', 1)
         return '{0} {1}'.format(II18n(manager_info).query_attribute('default_title_prefix', request=request) or '',
                                 title)