[CalendarServer-changes] [14538] CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/ datastore
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 9 16:34:24 PDT 2015
Revision: 14538
http://trac.calendarserver.org//changeset/14538
Author: sagen at apple.com
Date: 2015-03-09 16:34:24 -0700 (Mon, 09 Mar 2015)
Log Message:
-----------
CalendarHome.calendars( ) does not include trash
Modified Paths:
--------------
CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/sql.py
CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/test/test_sql.py
Modified: CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/sql.py 2015-03-09 22:53:51 UTC (rev 14537)
+++ CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/sql.py 2015-03-09 23:34:24 UTC (rev 14538)
@@ -488,11 +488,16 @@
createCalendarWithName = CommonHome.createChildWithName
removeCalendarWithName = CommonHome.removeChildWithName
calendarWithName = CommonHome.childWithName
- calendars = CommonHome.children
listCalendars = CommonHome.listChildren
loadCalendars = CommonHome.loadChildren
+
@inlineCallbacks
+ def calendars(self):
+ returnValue([c for c in (yield self.children()) if not c.isTrash()])
+
+
+ @inlineCallbacks
def remove(self):
ch = schema.CALENDAR_HOME
cb = schema.CALENDAR_BIND
@@ -1342,7 +1347,6 @@
@param use_it: C{True} if used for free busy, C{False} otherwise
@type use_it: C{bool}
"""
-
self._transp = _TRANSP_OPAQUE if use_it and (not self.isInbox() and not self.isTrash()) else _TRANSP_TRANSPARENT
cal = self._bindSchema
yield Update(
Modified: CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/test/test_sql.py 2015-03-09 22:53:51 UTC (rev 14537)
+++ CalendarServer/branches/users/sagen/trashcan-5/txdav/caldav/datastore/test/test_sql.py 2015-03-09 23:34:24 UTC (rev 14538)
@@ -496,7 +496,7 @@
)
supported_components = set()
- self.assertEqual(len(toCalendars), 3 + len(ical.allowedStoreComponents))
+ self.assertEqual(len(toCalendars), 2 + len(ical.allowedStoreComponents))
for calendar in toCalendars:
if calendar.name() in ("inbox", "trash"):
continue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150309/dda0f73a/attachment-0001.html>
More information about the calendarserver-changes
mailing list