[CalendarServer-changes] [14557] CalendarServer/trunk/twistedcaldav/method/report_sync_collection.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 10 19:16:09 PDT 2015


Revision: 14557
          http://trac.calendarserver.org//changeset/14557
Author:   cdaboo at apple.com
Date:     2015-03-10 19:16:09 -0700 (Tue, 10 Mar 2015)
Log Message:
-----------
Fix sync report when no properties are requested.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/method/report_sync_collection.py

Modified: CalendarServer/trunk/twistedcaldav/method/report_sync_collection.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_sync_collection.py	2015-03-10 21:23:57 UTC (rev 14556)
+++ CalendarServer/trunk/twistedcaldav/method/report_sync_collection.py	2015-03-11 02:16:09 UTC (rev 14557)
@@ -112,13 +112,16 @@
     for child, child_uri in ok_resources:
         href = element.HRef.fromString(child_uri)
         try:
-            yield responseForHref(
-                request,
-                responses,
-                href,
-                child,
-                functools.partial(_namedPropertiesForResource, dataAllowed=False, forbidden=False) if propertyreq else None,
-                propertyreq)
+            if propertyreq:
+                yield responseForHref(
+                    request,
+                    responses,
+                    href,
+                    child,
+                    functools.partial(_namedPropertiesForResource, dataAllowed=False, forbidden=False),
+                    propertyreq)
+            else:
+                responses.append(element.StatusResponse(element.HRef.fromString(href), element.Status.fromResponseCode(responsecode.OK)))
         except ConcurrentModification:
             # This can happen because of a race-condition between the
             # time we determine which resources exist and the deletion
@@ -130,13 +133,16 @@
     for child, child_uri in forbidden_resources:
         href = element.HRef.fromString(child_uri)
         try:
-            yield responseForHref(
-                request,
-                responses,
-                href,
-                child,
-                functools.partial(_namedPropertiesForResource, dataAllowed=False, forbidden=True) if propertyreq else None,
-                propertyreq)
+            if propertyreq:
+                yield responseForHref(
+                    request,
+                    responses,
+                    href,
+                    child,
+                    functools.partial(_namedPropertiesForResource, dataAllowed=False, forbidden=True),
+                    propertyreq)
+            else:
+                responses.append(element.StatusResponse(element.HRef.fromString(href), element.Status.fromResponseCode(responsecode.OK)))
         except ConcurrentModification:
             # This can happen because of a race-condition between the
             # time we determine which resources exist and the deletion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150310/5ed30241/attachment.html>


More information about the calendarserver-changes mailing list