[CalendarServer-changes] [259] CalendarServer/trunk/twistedcaldav/method/put_common.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 5 18:56:29 PDT 2006


Revision: 259
          http://trac.macosforge.org/projects/calendarserver/changeset/259
Author:   wsanchez at apple.com
Date:     2006-10-05 18:56:29 -0700 (Thu, 05 Oct 2006)

Log Message:
-----------
Handle None request

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

Modified: CalendarServer/trunk/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/put_common.py	2006-10-06 01:08:10 UTC (rev 258)
+++ CalendarServer/trunk/twistedcaldav/method/put_common.py	2006-10-06 01:56:29 UTC (rev 259)
@@ -74,7 +74,7 @@
     """
     
     try:
-        assert request is not None and destination is not None and destination_uri is not None and destinationparent is not None
+        assert destination is not None and destination_uri is not None and destinationparent is not None
         assert (source is None and sourceparent is None) or (source is not None and sourceparent is not None)
         assert (calendardata is None and source is not None) or (calendardata is not None and source is None)
         assert not deletesource or (deletesource and source is not None)
@@ -362,17 +362,22 @@
         """
 
         # Do quota checks on destination and source before we start messing with adding other files
-        destquota = waitForDeferred(destination.quota(request))
-        yield destquota
-        destquota = destquota.getResult()
-        if destquota is not None and destination.exists():
-            old_dest_size = waitForDeferred(destination.quotaSize(request))
-            yield old_dest_size
-            old_dest_size = old_dest_size.getResult()
+        if request is None:
+            destquota = None
         else:
-            old_dest_size = 0
+            destquota = waitForDeferred(destination.quota(request))
+            yield destquota
+            destquota = destquota.getResult()
+            if destquota is not None and destination.exists():
+                old_dest_size = waitForDeferred(destination.quotaSize(request))
+                yield old_dest_size
+                old_dest_size = old_dest_size.getResult()
+            else:
+                old_dest_size = 0
             
-        if source is not None:
+        if request is None:
+            sourcequota = None
+        elif source is not None:
             sourcequota = waitForDeferred(source.quota(request))
             yield sourcequota
             sourcequota = sourcequota.getResult()
@@ -451,7 +456,7 @@
                     NumberOfRecurrencesWithinLimits(PCDATAElement(str(ex.max_allowed)))
                 ))
 
-            destination.writeProperty(davxml.GETContentType.fromString("text/calendar"), request)
+            destination.writeDeadProperty(davxml.GETContentType.fromString("text/calendar"))
             return None
 
         def doRemoveDestinationIndex():
@@ -494,7 +499,7 @@
                     NumberOfRecurrencesWithinLimits(PCDATAElement(str(ex.max_allowed)))
                 ))
 
-            source.writeProperty(davxml.GETContentType.fromString("text/calendar"), request)
+            source.writeDeadProperty(davxml.GETContentType.fromString("text/calendar"))
             return None
 
         if deletesource:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061005/87b3ab57/attachment.html


More information about the calendarserver-changes mailing list