[CalendarServer-changes] [9375] CalendarServer/branches/users/gaya/sharedabgroups/txdav/common/ datastore/sql_legacy.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jun 19 19:10:24 PDT 2012
Revision: 9375
http://trac.macosforge.org/projects/calendarserver/changeset/9375
Author: gaya at apple.com
Date: 2012-06-19 19:10:22 -0700 (Tue, 19 Jun 2012)
Log Message:
-----------
add SQLLegacySharedGroupInvites.recordForPrincipalUID using parent resource id so existing invites are found
Modified Paths:
--------------
CalendarServer/branches/users/gaya/sharedabgroups/txdav/common/datastore/sql_legacy.py
Modified: CalendarServer/branches/users/gaya/sharedabgroups/txdav/common/datastore/sql_legacy.py
===================================================================
--- CalendarServer/branches/users/gaya/sharedabgroups/txdav/common/datastore/sql_legacy.py 2012-06-19 21:06:18 UTC (rev 9374)
+++ CalendarServer/branches/users/gaya/sharedabgroups/txdav/common/datastore/sql_legacy.py 2012-06-20 02:10:22 UTC (rev 9375)
@@ -518,7 +518,7 @@
@inlineCallbacks
def updateMembership(self, group):
- # first off, get a group list
+ # first off, get a group list
@inlineCallbacks
def groupMemberUIDs(group):
vCard = (yield group.component())
@@ -601,11 +601,14 @@
rows = yield self._idsForInviteUID.on(self._txn,
inviteuid=record.inviteuid)
+ print("xxx addOrUpdateRecord(): self._collection=%s" % (self._collection,))
+
+ print("xxx addOrUpdateRecord() record.inviteuid=%s, rows=%s" % (record.inviteuid, rows,))
+
# FIXME: Do the BIND table query before the INVITE table query because BIND currently has proper
# constraints in place, whereas INVITE does not. Really we need to do this in a sub-transaction so
# we can roll back if any one query fails.
if rows:
- print("xxx addOrUpdateRecord() rows=%s" % (rows,))
[[resourceID, homeResourceID]] = rows
yield self._updateBindQuery.on(
self._txn,
@@ -625,7 +628,6 @@
#get members in address book
- print("xxx addOrUpdateRecord(): self._collection=%s" % (self._collection,))
print("xxx _insertBindQuery(): homeID=%s, resourceID=%s, resourceName=%s, mode=%s, status=%s message=%s"
% (shareeHome._resourceID,
self._collection._parentCollection._resourceID,
@@ -669,6 +671,14 @@
self._collection._parentCollection.notifyChanged()
+ @inlineCallbacks
+ def recordForPrincipalUID(self, principalUID):
+ rows = yield self._inviteForPrincipalUIDQuery.on(
+ self._txn,
+ resourceID=self._collection._parentCollection._resourceID,
+ principalUID=principalUID
+ )
+ returnValue(self._makeInvite(rows[0]) if rows else None)
class SQLLegacyShares(object):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120619/dbf21505/attachment-0001.html>
More information about the calendarserver-changes
mailing list