<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13189] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/13189">13189</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-04-07 20:04:33 -0700 (Mon, 07 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adds print-group-info to csmp to print cached group information; fixes recordWithCalendarUserAddress( ) to honor the hasCalendar field</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertoolsprincipalspy">CalendarServer/trunk/calendarserver/tools/principals.py</a></li>
<li><a href="#CalendarServertrunktxdavcommondatastoresqlpy">CalendarServer/trunk/txdav/common/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxdavwhodelegatespy">CalendarServer/trunk/txdav/who/delegates.py</a></li>
<li><a href="#CalendarServertrunktxdavwhodirectorypy">CalendarServer/trunk/txdav/who/directory.py</a></li>
<li><a href="#CalendarServertrunktxdavwhogroupspy">CalendarServer/trunk/txdav/who/groups.py</a></li>
<li><a href="#CalendarServertrunktxdavwhotesttest_delegatespy">CalendarServer/trunk/txdav/who/test/test_delegates.py</a></li>
<li><a href="#CalendarServertrunktxdavwhotesttest_directorypy">CalendarServer/trunk/txdav/who/test/test_directory.py</a></li>
<li><a href="#CalendarServertrunktxdavwhotesttest_groupspy">CalendarServer/trunk/txdav/who/test/test_groups.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertoolsprincipalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/principals.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/principals.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/calendarserver/tools/principals.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx">                 &quot;remove&quot;,
</span><span class="cx">                 &quot;search=&quot;,
</span><span class="cx">                 &quot;list-principal-types&quot;,
</span><ins>+                &quot;print-group-info&quot;,
</ins><span class="cx">                 &quot;list-principals=&quot;,
</span><span class="cx">                 &quot;list-read-proxies&quot;,
</span><span class="cx">                 &quot;list-write-proxies&quot;,
</span><span class="lines">@@ -162,6 +163,7 @@
</span><span class="cx">     listPrincipalTypes = False
</span><span class="cx">     listPrincipals = None
</span><span class="cx">     searchPrincipals = None
</span><ins>+    printGroupInfo = False
</ins><span class="cx">     principalActions = []
</span><span class="cx">     verbose = False
</span><span class="cx"> 
</span><span class="lines">@@ -188,6 +190,9 @@
</span><span class="cx">         elif opt in (&quot;&quot;, &quot;--list-principal-types&quot;):
</span><span class="cx">             listPrincipalTypes = True
</span><span class="cx"> 
</span><ins>+        elif opt in (&quot;&quot;, &quot;--print-group-info&quot;):
+            printGroupInfo = True
+
</ins><span class="cx">         elif opt in (&quot;&quot;, &quot;--list-principals&quot;):
</span><span class="cx">             listPrincipals = arg
</span><span class="cx"> 
</span><span class="lines">@@ -269,6 +274,10 @@
</span><span class="cx">         function = runListPrincipalTypes
</span><span class="cx">         params = ()
</span><span class="cx"> 
</span><ins>+    elif printGroupInfo:
+        function = printGroupCacherInfo
+        params = ()
+
</ins><span class="cx">     elif addType:
</span><span class="cx"> 
</span><span class="cx">         try:
</span><span class="lines">@@ -763,6 +772,44 @@
</span><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+@inlineCallbacks
+def printGroupCacherInfo(service, store):
+    &quot;&quot;&quot;
+    Print all groups that have been delegated to, their cached members, and
+    who delegated to those groups.
+    &quot;&quot;&quot;
+    directory = store.directoryService()
+    txn = store.newTransaction()
+    groupUIDs = yield txn.allGroupDelegates()
+    for groupUID in groupUIDs:
+        groupID, name, membershipHash, modified = yield txn.groupByUID(
+            groupUID
+        )
+        print(&quot;Group: \&quot;{name} ({uid})&quot;.format(name=name, uid=groupUID))
+
+        for txt, readWrite in ((&quot;read-only&quot;, False), (&quot;read-write&quot;, True)):
+            delegatorUIDs = yield txn.delegatorsToGroup(groupID, readWrite)
+            for delegatorUID in delegatorUIDs:
+                delegator = yield directory.recordWithUID(delegatorUID)
+                print(
+                    &quot;...has {rw} access to {rec}&quot;.format(
+                        rw=txt, rec=prettyRecord(delegator)
+                    )
+                )
+
+        print(&quot;Group members:&quot;)
+        memberUIDs = yield txn.membersOfGroup(groupID)
+        for memberUID in memberUIDs:
+            record = yield directory.recordWithUID(memberUID)
+            print(prettyRecord(record))
+
+        print(&quot;Last cached: {} GMT&quot;.format(modified))
+        print()
+
+    yield txn.commit()
+
+
+
</ins><span class="cx"> def abort(msg, status=1):
</span><span class="cx">     sys.stdout.write(&quot;%s\n&quot; % (msg,))
</span><span class="cx">     try:
</span></span></pre></div>
<a id="CalendarServertrunktxdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/common/datastore/sql.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/common/datastore/sql.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/common/datastore/sql.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -957,7 +957,7 @@
</span><span class="cx">     def _groupByUID(cls):
</span><span class="cx">         gr = schema.GROUPS
</span><span class="cx">         return Select(
</span><del>-            [gr.GROUP_ID, gr.NAME, gr.MEMBERSHIP_HASH],
</del><ins>+            [gr.GROUP_ID, gr.NAME, gr.MEMBERSHIP_HASH, gr.MODIFIED],
</ins><span class="cx">             From=gr,
</span><span class="cx">             Where=(gr.GROUP_GUID == Parameter(&quot;groupUID&quot;))
</span><span class="cx">         )
</span><span class="lines">@@ -1020,7 +1020,7 @@
</span><span class="cx">         @type groupUID: C{unicode}
</span><span class="cx"> 
</span><span class="cx">         @return: Deferred firing with tuple of group ID C{str}, group name
</span><del>-            C{unicode}, and membership hash C{str}
</del><ins>+            C{unicode}, membership hash C{str}, and modified timestamp
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         results = (
</span><span class="cx">             yield self._groupByUID.on(
</span><span class="lines">@@ -1032,6 +1032,7 @@
</span><span class="cx">                 results[0][0],  # group id
</span><span class="cx">                 results[0][1].decode(&quot;utf-8&quot;),  # name
</span><span class="cx">                 results[0][2],  # membership hash
</span><ins>+                results[0][3],  # modified timestamp
</ins><span class="cx">             ))
</span><span class="cx">         else:
</span><span class="cx">             savepoint = SavepointAction(&quot;groupByUID&quot;)
</span><span class="lines">@@ -1050,6 +1051,7 @@
</span><span class="cx">                         results[0][0],  # group id
</span><span class="cx">                         results[0][1].decode(&quot;utf-8&quot;),  # name
</span><span class="cx">                         results[0][2],  # membership hash
</span><ins>+                        results[0][3],  # modified timestamp
</ins><span class="cx">                     ))
</span><span class="cx">                 else:
</span><span class="cx">                     raise
</span><span class="lines">@@ -1065,6 +1067,7 @@
</span><span class="cx">                         results[0][0],  # group id
</span><span class="cx">                         results[0][1].decode(&quot;utf-8&quot;),  # name
</span><span class="cx">                         results[0][2],  # membership hash
</span><ins>+                        results[0][3],  # modified timestamp
</ins><span class="cx">                     ))
</span><span class="cx">                 else:
</span><span class="cx">                     raise
</span><span class="lines">@@ -1173,15 +1176,15 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def membersOfGroup(self, groupID):
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        Returns the cached set of GUIDs for members of the given groupID.
</del><ins>+        Returns the cached set of UIDs for members of the given groupID.
</ins><span class="cx">         Sub-groups are not returned in the results but their members are,
</span><span class="cx">         because the group membership has already been expanded/flattened
</span><span class="cx">         before storing in the db.
</span><span class="cx"> 
</span><span class="cx">         @param groupID: the group ID
</span><span class="cx">         @type groupID: C{int}
</span><del>-        @return: the set of member GUIDs
-        @rtype: a Deferred which fires with a set() of C{str} GUIDs
</del><ins>+        @return: the set of member UIDs
+        @rtype: a Deferred which fires with a set() of C{str} UIDs
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         members = set()
</span><span class="cx">         results = (yield self._selectGroupMembersQuery.on(self, groupID=groupID))
</span><span class="lines">@@ -1306,6 +1309,20 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @classproperty
</span><ins>+    def _selectDelegatorsToGroupQuery(cls):
+        dg = schema.DELEGATE_GROUPS
+        return Select(
+            [dg.DELEGATOR],
+            From=dg,
+            Where=(
+                dg.GROUP_ID == Parameter(&quot;delegateGroup&quot;)
+            ).And(
+                dg.READ_WRITE == Parameter(&quot;readWrite&quot;)
+            )
+        )
+
+
+    @classproperty
</ins><span class="cx">     def _selectDelegateGroupsQuery(cls):
</span><span class="cx">         ds = schema.DELEGATE_GROUPS
</span><span class="cx">         gr = schema.GROUPS
</span><span class="lines">@@ -1621,7 +1638,7 @@
</span><span class="cx">         @param readWrite: the access-type to check for; read and write
</span><span class="cx">             access if True, otherwise read-only access
</span><span class="cx">         @type readWrite: C{boolean}
</span><del>-        @returns: the GUIDs of the delegators (for the specified access
</del><ins>+        @returns: the UIDs of the delegators (for the specified access
</ins><span class="cx">             type)
</span><span class="cx">         @rtype: a Deferred resulting in a set
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -1654,6 +1671,35 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><ins>+    def delegatorsToGroup(self, delegateGroupID, readWrite):
+        &quot;&quot;&quot;
+        Return the UIDs of those who have delegated to the given group with the
+        given access level.
+
+        @param delegateGroupID: the group ID of the delegate group
+        @type delegateGroupID: C{int}
+        @param readWrite: the access-type to check for; read and write
+            access if True, otherwise read-only access
+        @type readWrite: C{boolean}
+        @returns: the UIDs of the delegators (for the specified access
+            type)
+        @rtype: a Deferred resulting in a set
+
+        &quot;&quot;&quot;
+        delegators = set()
+        results = (
+            yield self._selectDelegatorsToGroupQuery.on(
+                self,
+                delegateGroup=delegateGroupID,
+                readWrite=1 if readWrite else 0
+            )
+        )
+        for row in results:
+            delegators.add(row[0].decode(&quot;utf-8&quot;))
+        returnValue(delegators)
+
+
+    @inlineCallbacks
</ins><span class="cx">     def allGroupDelegates(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Return the UIDs of all groups which have been delegated to.  Useful
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhodelegatespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/delegates.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/delegates.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/delegates.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -230,7 +230,9 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     if delegate.recordType == BaseRecordType.group:
</span><span class="cx">         # find the groupID
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(delegate.uid))
</del><ins>+        groupID, name, membershipHash, modified = yield txn.groupByUID(
+            delegate.uid
+        )
</ins><span class="cx">         yield txn.addDelegateGroup(delegator.uid, groupID, readWrite)
</span><span class="cx">     else:
</span><span class="cx">         yield txn.addDelegate(delegator.uid, delegate.uid, readWrite)
</span><span class="lines">@@ -251,7 +253,9 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     if delegate.recordType == BaseRecordType.group:
</span><span class="cx">         # find the groupID
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(delegate.uid))
</del><ins>+        groupID, name, membershipHash, modified = yield txn.groupByUID(
+            delegate.uid
+        )
</ins><span class="cx">         yield txn.removeDelegateGroup(delegator.uid, groupID, readWrite)
</span><span class="cx">     else:
</span><span class="cx">         yield txn.removeDelegate(delegator.uid, delegate.uid, readWrite)
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/directory.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/directory.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/directory.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">         elif address.startswith(&quot;mailto:&quot;):
</span><span class="cx">             records = yield self.recordsWithEmailAddress(address[7:])
</span><span class="cx">             if records:
</span><del>-                returnValue(records[0])
</del><ins>+                record = records[0]
</ins><span class="cx">             else:
</span><span class="cx">                 returnValue(None)
</span><span class="cx">         elif address.startswith(&quot;/principals/&quot;):
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhogroupspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/groups.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/groups.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/groups.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -269,11 +269,11 @@
</span><span class="cx">             ) in changed:
</span><span class="cx">                 readDelegateGroupID = writeDelegateGroupID = None
</span><span class="cx">                 if readDelegateUID:
</span><del>-                    readDelegateGroupID, _ignore_name, hash = (
</del><ins>+                    readDelegateGroupID, _ignore_name, hash, modified = (
</ins><span class="cx">                         yield txn.groupByUID(readDelegateUID)
</span><span class="cx">                     )
</span><span class="cx">                 if writeDelegateUID:
</span><del>-                    writeDelegateGroupID, _ignore_name, hash = (
</del><ins>+                    writeDelegateGroupID, _ignore_name, hash, modified = (
</ins><span class="cx">                         yield txn.groupByUID(writeDelegateUID)
</span><span class="cx">                     )
</span><span class="cx">                 yield txn.assignExternalDelegates(
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx">             for member in members:
</span><span class="cx">                 membershipHashContent.update(str(member.uid))
</span><span class="cx">             membershipHash = membershipHashContent.hexdigest()
</span><del>-            groupID, _ignore_cachedName, cachedMembershipHash = (
</del><ins>+            groupID, _ignore_cachedName, cachedMembershipHash, modified = (
</ins><span class="cx">                 yield txn.groupByUID(groupUID)
</span><span class="cx">             )
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhotesttest_delegatespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/test/test_delegates.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/test/test_delegates.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/test/test_delegates.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx">                 yield self.directory.recordWithShortName(RecordType.user, name)
</span><span class="cx">             )
</span><span class="cx">             newSet.add(record.uid)
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(group1.uid))
</del><ins>+        groupID, name, membershipHash, modified = (yield txn.groupByUID(group1.uid))
</ins><span class="cx">         numAdded, numRemoved = (
</span><span class="cx">             yield self.groupCacher.synchronizeMembers(txn, groupID, newSet)
</span><span class="cx">         )
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhotesttest_directorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/test/test_directory.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/test/test_directory.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/test/test_directory.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -123,3 +123,22 @@
</span><span class="cx">         )
</span><span class="cx">         records = yield self.directory.recordsFromExpression(expression)
</span><span class="cx">         self.assertEquals(len(records), 1)
</span><ins>+
+
+    @inlineCallbacks
+    def test_recordWithCalendarUserAddress(self):
+        &quot;&quot;&quot;
+        Make sure hasCalendars is honored
+        &quot;&quot;&quot;
+
+        # hasCalendars
+        record = yield self.directory.recordWithCalendarUserAddress(
+            u&quot;mailto:wsanchez@example.com&quot;
+        )
+        self.assertNotEquals(record, None)
+
+        # no hasCalendars
+        record = yield self.directory.recordWithCalendarUserAddress(
+            u&quot;mailto:nocalendar@example.com&quot;
+        )
+        self.assertEquals(record, None)
</ins></span></pre></div>
<a id="CalendarServertrunktxdavwhotesttest_groupspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/test/test_groups.py (13188 => 13189)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/test/test_groups.py        2014-04-08 02:05:39 UTC (rev 13188)
+++ CalendarServer/trunk/txdav/who/test/test_groups.py        2014-04-08 03:04:33 UTC (rev 13189)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">         record = yield self.directory.recordWithUID(u&quot;__top_group_1__&quot;)
</span><span class="cx">         yield self.groupCacher.refreshGroup(txn, record.uid)
</span><span class="cx"> 
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(record.uid))
</del><ins>+        groupID, name, membershipHash, modified = (yield txn.groupByUID(record.uid))
</ins><span class="cx"> 
</span><span class="cx">         self.assertEquals(membershipHash, &quot;553eb54e3bbb26582198ee04541dbee4&quot;)
</span><span class="cx"> 
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         # Refresh the group so it's assigned a group_id
</span><span class="cx">         uid = u&quot;__top_group_1__&quot;
</span><span class="cx">         yield self.groupCacher.refreshGroup(txn, uid)
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(uid))
</del><ins>+        groupID, name, membershipHash, modified = (yield txn.groupByUID(uid))
</ins><span class="cx"> 
</span><span class="cx">         # Remove two members, and add one member
</span><span class="cx">         newSet = set()
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">         uid = u&quot;__top_group_1__&quot;
</span><span class="cx">         hash = &quot;553eb54e3bbb26582198ee04541dbee4&quot;
</span><span class="cx">         yield self.groupCacher.refreshGroup(txn, uid)
</span><del>-        groupID, name, membershipHash = (yield txn.groupByUID(uid))
</del><ins>+        groupID, name, membershipHash, modified = yield txn.groupByUID(uid)
</ins><span class="cx">         results = (yield txn.groupByID(groupID))
</span><span class="cx">         self.assertEquals((uid, u&quot;Top Group 1&quot;, hash), results)
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>