[CalendarServer-changes] [2708] CalendarServer/trunk/twistedcaldav/static.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 17 10:07:14 PDT 2008


Revision: 2708
          http://trac.macosforge.org/projects/calendarserver/changeset/2708
Author:   cdaboo at apple.com
Date:     2008-07-17 10:07:14 -0700 (Thu, 17 Jul 2008)
Log Message:
-----------
Make sure we do not duplicate VTIMEZONEs.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/static.py

Modified: CalendarServer/trunk/twistedcaldav/static.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/static.py	2008-07-16 23:00:56 UTC (rev 2707)
+++ CalendarServer/trunk/twistedcaldav/static.py	2008-07-17 17:07:14 UTC (rev 2708)
@@ -190,6 +190,7 @@
             filteredaces = yield self.inheritedACEsforChildren(request)
 
             # Must verify ACLs which means we need a request object at this point
+            tzids = set()
             for name, uid, type in self.index().search(None): #@UnusedVariable
                 try:
                     child = yield request.locateChildResource(self, name)
@@ -207,6 +208,14 @@
                     assert subcalendar.name() == "VCALENDAR"
 
                     for component in subcalendar.subcomponents():
+                        
+                        # Only insert VTIMEZONEs once
+                        if component.name() == "VTIMEZONE":
+                            tzid = component.propertyValue("TZID")
+                            if tzid in tzids:
+                                continue
+                            tzids.add(tzid)
+
                         calendar.addComponent(component)
 
             returnValue(calendar)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080717/9269d769/attachment.html 


More information about the calendarserver-changes mailing list