[CalendarServer-changes] [10800] CalendarServer/trunk/twext/who/directory.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 21 20:58:50 PST 2013


Revision: 10800
          http://trac.calendarserver.org//changeset/10800
Author:   wsanchez at apple.com
Date:     2013-02-21 20:58:50 -0800 (Thu, 21 Feb 2013)
Log Message:
-----------
Return failure; don't raise.

Modified Paths:
--------------
    CalendarServer/trunk/twext/who/directory.py

Modified: CalendarServer/trunk/twext/who/directory.py
===================================================================
--- CalendarServer/trunk/twext/who/directory.py	2013-02-22 04:30:06 UTC (rev 10799)
+++ CalendarServer/trunk/twext/who/directory.py	2013-02-22 04:58:50 UTC (rev 10800)
@@ -117,17 +117,21 @@
     def recordsWithFieldValue(self, fieldName, value):
         return self.recordsFromExpression(MatchExpression(fieldName, value))
 
+
     @inlineCallbacks
     def recordWithUID(self, uid):
         returnValue(uniqueResult((yield self.recordsWithFieldValue(FieldName.uid, uid))))
                
+
     @inlineCallbacks
     def recordWithGUID(self, guid):
         returnValue(uniqueResult((yield self.recordsWithFieldValue(FieldName.guid, guid))))
 
+
     def recordsWithRecordType(self, recordType):
         return self.recordsWithFieldValue(FieldName.recordType, recordType)
 
+
     @inlineCallbacks
     def recordWithShortName(self, recordType, shortName):
         returnValue(uniqueResult((yield self.recordsFromQuery((
@@ -135,16 +139,19 @@
             MatchExpression(FieldName.shortNames, shortName ),
         )))))
 
+
     def recordsWithEmailAddress(self, emailAddress):
         return self.recordsWithFieldValue(FieldName.emailAddresses, emailAddress)
 
+
     def updateRecords(self, records, create=False):
         for record in records:
-            raise NotAllowedError("Record updates not allowed.")
+            return fail(NotAllowedError("Record updates not allowed."))
 
+
     def removeRecords(self, uids):
         for uid in uids:
-            raise NotAllowedError("Record removal not allowed.")
+            return fail(NotAllowedError("Record removal not allowed."))
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130221/bf549fb6/attachment.html>


More information about the calendarserver-changes mailing list