Corrected display of creation and last modification dates of external files
authorThierry Florac <tflorac@ulthar.net>
Wed, 02 Sep 2020 17:47:53 +0200
changeset 1417 2d29fd159410
parent 1416 f385efe47521
child 1418 1854a7294cc2
Corrected display of creation and last modification dates of external files
src/pyams_content/component/extfile/zmi/__init__.py
--- a/src/pyams_content/component/extfile/zmi/__init__.py	Wed Sep 02 17:18:34 2020 +0200
+++ b/src/pyams_content/component/extfile/zmi/__init__.py	Wed Sep 02 17:47:53 2020 +0200
@@ -419,6 +419,8 @@
     weight = 40
 
     def getValue(self, obj):
+        if not IExtFile.providedBy(obj):
+            return '--'
         dc = IZopeDublinCore(obj, None)
         if dc is not None:
             return format_datetime(tztime(dc.created), SH_DATETIME_FORMAT, request=self.request)
@@ -435,6 +437,8 @@
     weight = 45
 
     def getValue(self, obj):
+        if not IExtFile.providedBy(obj):
+            return '--'
         dc = IZopeDublinCore(obj)
         last = None
         if obj.data: