[Zope-Checkins] CVS: Zope2 - PropertySheets.py:1.72

andreas@serenade.digicool.com andreas@serenade.digicool.com
Tue, 10 Apr 2001 16:37:00 -0400


Update of /cvs-repository/Zope2/lib/python/OFS
In directory serenade.digicool.com:/tmp/cvs-serv32582

Modified Files:
	PropertySheets.py 
Log Message:
Fix for Webdav/GoLive problem: Collector #2150 (submitted by Martijn)



--- Updated File PropertySheets.py in package Zope2 --
--- PropertySheets.py	2001/04/10 14:14:12	1.71
+++ PropertySheets.py	2001/04/10 20:36:59	1.72
@@ -529,7 +529,6 @@
     pm=({'id':'creationdate',     'mode':'r'},
         {'id':'displayname',      'mode':'r'},
         {'id':'resourcetype',     'mode':'r'},
-        {'id':'getlastmodified',  'mode':'r'},
         {'id':'getcontenttype',   'mode':'r'},
         {'id':'getcontentlength', 'mode':'r'},
         {'id':'source',           'mode':'r'},
@@ -553,6 +552,9 @@
         raise ValueError, '%s cannot be deleted.' % id
 
     def _propertyMap(self):
+        # Only use getlastmodified if returns a value
+        if hasattr(self.v_self(), '_p_mtime'):
+            return self.pm + ({'id':'getlastmodified',  'mode':'r'},)
         return self.pm
     
     def propertyMap(self):
@@ -572,10 +574,7 @@
         return ''
 
     def dav__getlastmodified(self):
-        vself=self.v_self()
-        if hasattr(vself, '_p_mtime'):
-            return rfc1123_date(vself._p_mtime)
-        return ''
+        return rfc1123_date(self.v_self()._p_mtime)
 
     def dav__getcontenttype(self):
         vself=self.v_self()